• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to enforce C89-style variable declarations in gcc ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: How to enforce C89-style variable declarations in gcc ?
      • From: Peter O'Gorman <email@hidden>
  • Prev by Date: Re: A possibly dumb question...
  • Next by Date: Single Project with Mac and iPhone targets
  • Previous by thread: Re: A possibly dumb question...
  • Next by thread: Re: How to enforce C89-style variable declarations in gcc ?
  • Index(es):
    • Date
    • Thread