bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compiling emacs-20.7 with gcc 2.7.2.1 on m64k-next-nextstep4


From: Pascal Bourguignon
Subject: Re: Compiling emacs-20.7 with gcc 2.7.2.1 on m64k-next-nextstep4
Date: Thu, 14 Jun 2001 10:16:18 +0200 (CEST)

 
> > I had  some problems with the  OPENSTEP 4.2 compiler  (g)cc 2.7.2.1 to
> > compile emacs-20.7:
> > 
> > cc: Internal compiler error: program cc1obj got fatal signal 11
> > gnumake: *** [syntax.o] Error 1
> 
> syntax.c requires some pretty preposterous amounts of memory to compile.  
> If you have a means to control the size of the run-time stack of 
> programs, try enlarging the stack limit available to cc1obj.
> 
> If that helps, please tell here, because this should be a useful addition 
> to etc/PROBLEMS.


I solved the problem by replacing macros by functions.


    static int update_syntax_table_forward(int from)
    {
        return(UPDATE_SYNTAX_TABLE_FORWARD(from));
    }/*update_syntax_table_forward*/


    void inc_both(int* charpos,int* bytepos)
    {
        INC_BOTH((*charpos),(*bytepos));
    }/*inc_both*/

 
    void inc_from(int* from,int* from_byte,
                  int* prev_from,int* prev_from_byte,int* prev_from_syntax)
    {
        *prev_from = *from;
        *prev_from_byte = *from_byte;
        *prev_from_syntax = SYNTAX_WITH_FLAGS (FETCH_CHAR (*prev_from_byte));
        inc_both (from, from_byte);     
        UPDATE_SYNTAX_TABLE_FORWARD (*from);
    }/*inc_from*/


and replacing INC_BOTH(a,b) by inc_both(&a,&b), etc.






As I  said, I think  that the  usage of macros  done in the  source of
emacs  is   preposterous.   Most  of   them  should  be   replaced  by
functions. Actually macros should almost never be used. They're just a
kludge to paliate  deficiencies of C. No high  level language has such
macros. The only place where  macros could be allowed, _was_ to define
constants  (now we should  use "const  int cst=1;"),  and to  define a
_few_  high level  constructs, such  as the  NS_DURING /  NS_HANDLER /
NS_ENDHANDLER  exception handling  macros  of NeXTSTEP.  Well, and  to
protect  from   multiple  inclusions  of  headers,   since  RMS  can't
understand  that  it's better  to  use  #import  (without outputing  a
nagging warning) instead of #include...



-- 
__Pascal_Bourguignon__              (o_ Software patents are endangering
()  ASCII ribbon against html email //\ the computer industry all around
/\  and Microsoft attachments.      V_/ the world http://lpf.ai.mit.edu/
1962:DO20I=1.100  2001:my($f)=`fortune`;  http://petition.eurolinux.org/

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT d? s++:++(+++)>++ a C+++  UB+++L++++$S+X++++>$ P- L+++ E++ W++
N++ o-- K- w------ O- M++$ V PS+E++ Y++ PGP++ t+ 5? X+ R !tv b++(+)
DI+++ D++ G++ e+++ h+(++) r? y---? UF++++
------END GEEK CODE BLOCK------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]