-pedantic compiler option causes dependency compile errors

Minor issues with the Ogre API that can be trivial to fix
Post Reply
d000hg
Goblin
Posts: 257
Joined: Tue Sep 02, 2008 9:41 pm
x 1

-pedantic compiler option causes dependency compile errors

Post by d000hg »

In XCode 3, the Ogre 1.8.1 CMake script generates -pedantic as a C++ flag. This leads to compile errors in dependency headers which have trailing semi-colons:

Code: Select all

if(...)
{
};
It wasn't a problem in the 1.8 RC version. Is this a deliberate change, or maybe CMake for Xcode 3 didn't get properly QA'd?

Can anyone tell me where/how to fix this in my own CMake script rather than fixing it in the generated Xcode projects?
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: -pedantic compiler option causes dependency compile erro

Post by masterfalcon »

To be honest Xcode 3 isn't tested at all anymore. But GCC bundled with Xcode 3 must treat them as errors rather than warnings.
d000hg
Goblin
Posts: 257
Joined: Tue Sep 02, 2008 9:41 pm
x 1

Re: -pedantic compiler option causes dependency compile erro

Post by d000hg »

Yeah, it does. But my question I guess is why -pedantic got added, it wasn't there in 1.8 RC which suggests it was deliberate? Or do Xcode3/4 share the same CMake scripts somehow?
User avatar
Mikachu
Gnoll
Posts: 603
Joined: Thu Jul 28, 2005 4:11 pm
Location: Nice, France
x 35

Re: -pedantic compiler option causes dependency compile erro

Post by Mikachu »

d000hg wrote:But my question I guess is why -pedantic got added
I think Svenstaro pushed for adoption of these flags (there have been a few discussions on the topic in developper forum)
d000hg wrote:This leads to compile errors in dependency headers which have trailing semi-colons
It is generally a bad thing to enforce strict rules on headers you can't modify.
A workaround is to change this : (in CMakeLists.txt)

Code: Select all

include_directories(${MY_DEPENDENCIES_DIR})
into that :

Code: Select all

include_directories(SYSTEM ${MY_DEPENDENCIES_DIR})
OgreProcedural - Procedural Geometry for Ogre3D
Post Reply