R
regis
Greetings,
static int mode= 1;
static int half0 (int x) { return x / 2; }
static int half1 (int x) { return x >> 1; }
inline int half (int x) { return mode ? half1 (x) : half0 (x); }
Since version 4.3, it seems that gcc with -std=c99 warns:
mode is static but used in inline function half which is not static
half1 is static but used in inline function half which is not static
half0 is static but used in inline function half which is not static
(Same warnings if half0 and half1 are static inline)
As far as C99 is concerned, Is gcc right
for these uses of static variables and static functions
in inline non-static functions ?
That is, is it illegal ?
Thanks,
static int mode= 1;
static int half0 (int x) { return x / 2; }
static int half1 (int x) { return x >> 1; }
inline int half (int x) { return mode ? half1 (x) : half0 (x); }
Since version 4.3, it seems that gcc with -std=c99 warns:
mode is static but used in inline function half which is not static
half1 is static but used in inline function half which is not static
half0 is static but used in inline function half which is not static
(Same warnings if half0 and half1 are static inline)
As far as C99 is concerned, Is gcc right
for these uses of static variables and static functions
in inline non-static functions ?
That is, is it illegal ?
Thanks,