I have a very large program that compiles with gcc without warning.
If I turn on c99 --std = c99 mode on the command line, it will give a huge amount of warnings and errors.
But I love the idiom for(int i=0; i<20; i++){ code }
instead of {int i; for (i=0; i<20; i++){ code }} {int i; for (i=0; i<20; i++){ code }}
Is there a way to tell gcc to resolve this and only that?
Alternatively, is there a way to enable c99 mode in the specific functions I'm working on? Something like
#pragma c99 on for(int i=0; i<99; i++) { code } #pragma c99 off
John lawrence aspden
source share