Is the gcc -sequence-point flag turned off?

I get a warning for this line:

e = strtol(++s, (char **)&s, 10); 

Moving ++s to a separate statement causes the warning to go away, but as far as I can tell, this warning is completely wrong. The value of s used only once when calculating ++s . The second use of s is only its address. Is something missing?

+4
source share
1 answer

Newer versions of gcc (4.4.3 or 4.4.5) do not generate warnings for the line you posted. Generating a warning seems to be a bug in older versions of gcc.

+4
source

All Articles