attribute pure and gcse
Kaveh R. Ghazi
ghazi@caip.rutgers.edu
Sun Apr 18 02:07:00 GMT 2004
> A workaround is to repeat the function prototype including the pure
> attribute *after* the function declaration, i.e.
>
> static int square(int a) __attribute__ ((pure));
>
> static int square(int a)
> {
> [...]
> }
>
> static int square(int a) __attribute__ ((pure));
>
> int main()
> {
Eww yuck. ;)
Instead put the attribute on the function definition and eliminate all
the prototypes. Then there's no "duplicate" decl. E.g.:
static int __attribute__ ((__pure__))
square(int a)
{
[...]
}
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu
More information about the Gcc
mailing list