This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Simplify preprocessor conditional in push_block


ebotcazou@libertysurf.fr (Eric Botcazou)  wrote on 06.10.03 in <200310061906.21650.ebotcazou@libertysurf.fr>:

> > Better, provide
> >
> > #ifndef STACK_GROWS_DOWNWARD
> > #define STACK_GROWS_DOWNWARD 1
> > #endif
> >
> > in defaults.h, then delete all existing definitions, and make all
> > ports that currently do _not_ define this macro instead define it as
> >
> > #define STACK_GROWS_DOWNWARD 0
> >
> > ... and then you can use just
> >
> >   if (STACK_GROWS_DOWNWARD)
> >
> > in push_block (but you'll have to tweak all other locations that use
> > it, too.)
>
> Big, big hammer just to get rid of 5 problematic lines... now I understand
> why they are still there :-)

Well, the argument here is that #ifdef is bad, and you really, really want  
the compiler to parse all the code so you immediately know when you put a  
silly error in there.

Plus, if () is more readable.

MfG Kai


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]