This is the mail archive of the gcc@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]

Re: Bad macros in gcc


"H . J . Lu" wrote:
> 
> #define FOO(BAR) \
>   do \
>     { \
>       int __s;
>       for (__s, ....) \
>         .. BAR... \
>     } \
>   while (0)
> 
> Shouldn't gcc do something like that or turn FOO into a function?

The new gcc_target structure exists for the purpose of turning
all of these into functions, since there is no value in them being
macros, and potential hazards as you observe.  (The use of macros in
the first place is historical - seemed like a good idea in 1986...)

Stan


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