This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bad macros in gcc
- To: "H . J . Lu" <hjl at lucon dot org>
- Subject: Re: Bad macros in gcc
- From: Stan Shebs <shebs at apple dot com>
- Date: Wed, 11 Jul 2001 15:57:24 -0700
- CC: gcc at gcc dot gnu dot org
- References: <20010711153325.A18044@lucon.org>
"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