How to enforce C89-style variable declarations in gcc ?
How to enforce C89-style variable declarations in gcc ?
- Subject: How to enforce C89-style variable declarations in gcc ?
- From: Paul Russell <email@hidden>
- Date: Wed, 23 Jun 2010 08:52:00 +0100
I work on a code base which is mostly C with a little C++, and is mostly built with gcc (Mac OS X and Linux) but occasionally it needs to be built with MSVC. Microsoft's C compiler is still pretty much C89 with a few minor extensions, and it still doesn't support mixed code and variable definitions à la C++/C99. So I need to find a way to prevent developers from writing out-of-order code/variable definitions while they are working with gcc, otherwise the build subsequently breaks on WIN32. If I use gcc -std=c89 then everything breaks because C++-style comments are not allowed (there may be other issues too, but I haven't looked into this any further). If I use gcc -std=gnu89 then the out-of-order code/variable definitions are allowed, so that doesn't help me either. Any ideas ? I guess I just need something like gcc -std=c99 -fno-inline-variable-definitions, if such an option existed.
Paul
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden