Bug #14520 2008-09-18 20:06

amarty

if option pch_mode absent in .cbp, wrong value aplied by def

If there is no <Option pch_mode="N"/> tag in project file (.cbp), aplied value 1 (pchObjectDir), but in project settings - PCH strategy wroten that the default value is "Generate PCH alongside original header" - 2 (pchSourceFile).

Category
Application::WrongBehaviour
Group
 
Status
Open
Close date
 
Assigned to
 
geister 2008-09-21 05:37

Some information would be useful:

Code::Blocks version

Platform/Operating system

How is the behavior wrong?

Here's what I have collected on this so far.

Version: SVN Revision 5208

File: sdk/cbproject.cpp

Line: 60

Function: cbProject::cbProject(const wxString& filename)

m_PCHMode(pchSourceFile)

When creating the cbProject object, it initializes m_PCHMode to pchSourceFile (2).

"In a file alongside the source header (with .gch appended)." as the comments say.

I don't know how this is wrong behavior as the comments might be wrong...

File: include/cbproject.h

Line: 83

pchSourceDir = 0, /// In a dir (named by the PCH) on the same level as the source header (default).

The comments say it is the default value, but pchSourceFile is when instantiating cbProject.

That is the only wrong behavior I can see there.

However...

File: sdk/projectloader.cpp

Line: 385, 423-424, 448

Function: void ProjectLoader::DoProjectOptions(TiXmlElement* parentNode)

If the Code::Blocks project is old (before version 1.2, we are at 1.6), it will default to pchSourceDir (the default value as defined by the comments), otherwise it is pchObjectDir.

So, as far as I can tell, you are either loading an old project file (or using an old version of Code::Blocks), or I was wrong somewhere. But, I still don't see how this would be wrong behavior.

amarty 2008-09-21 09:00

Cobedlocks v8.02 - Windows, from package woth MinGW; Codeblocks 8.02 - Linux.

In a project properties dialog option "Generate PCH alongside original header" marked as this is a default value. I think, in every cases this value must be applied if no other taken. My project file (marked with v1.6, but it is generated by my tools and may be have some wrongs) does not contain tag <Option pch_mode="N"/>, and when I open this project, the "Generate PCH in the object output dir" pch strategy apllied. Thats are the facts, and I think this is an incorrect behavior of C::B.