4

I'm getting a warning for this line:

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

Moving the ++s to a separate statement makes the warning go away, but as far as I can tell, this warning is completely incorrect. The value of s is only used once, in the computation of ++s. The second use of s is only to take its address. Is there something I'm missing?

R.. GitHub STOP HELPING ICE
  • 208,859
  • 35
  • 376
  • 711

1 Answers1

4

Newer versions of gcc (4.4.3 or 4.4.5) do not generate any warning for the line you posted. The generation of the warning there appears to be a bug in older gcc versions.

Kamal
  • 7,160
  • 2
  • 21
  • 12