Author Topic: Is it a bug or a feature?  (Read 4924 times)

Max

  • Guest
Is it a bug or a feature?
« on: November 12, 2008, 10:02:01 pm »
Hi,

I'm attaching a 7z file in which a very simple project is included.

Try to compile it. Ok it works. Now modify the file mybase.h (as you like), now if you re-compile the project you get

-------------- Build: Debug in testDepend ---------------

Target is up to date.
Nothing to be done.

instead of getting the files re-compiled (both mybase.cpp and myderived.cpp depend on mybase.h).

Now repeat the test but before repeating change any #include <stuff> to #include "stuff".

With this change everything is working. modifying mybase.h all the sources that depend on it are recompiled.

Is it a bug or a feature?

Nightly 5299, windows xp SP3, both "current" and "top project" directories are explicitly added.

thx

Max


[attachment deleted by admin]

Offline Seronis

  • Almost regular
  • **
  • Posts: 197
Re: Is it a bug or a feature?
« Reply #1 on: November 15, 2008, 07:14:15 am »
brackets are used on 'library headers' which is generally assumed to be something that doesnt change.  quotation marks are generally used for project headers.  So this is more an optimization (feature) and not a bug.

Offline rhf

  • Multiple posting newcomer
  • *
  • Posts: 123
Re: Is it a bug or a feature?
« Reply #2 on: November 15, 2008, 02:44:11 pm »
Hmmm.  It sure seems like a bug to me. I generally add my library headers to my project and include them with the <...> notation.
Recently, I have been experiencing the same problem on Windows XP and assumed that maybe my clock was messed up.
When I modify an included header file, the editor indicates with the * that the file has been modified.
Running Build then saves the file but says the Target is up to date. I have to run Rebuild to force re-compilation.
If this is really an intended optimization, I hope there is a way to inhibit it.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Is it a bug or a feature?
« Reply #3 on: November 15, 2008, 03:12:19 pm »
Are you sure you don't have the headers twice on yourjavascript:void(0); system, and the compiler/preprocessor finds an unchanged version, because it comes earlier in search path?

If a header is included with brackets, it has to be in a system directory, or its search path has to be explicitely included, headers included with quotes are searched first in the same directory where the source file is.

If your headers with brackets get found without to include the path, there are most likely header-files with the same name inside the system searchpath.
I don't know if it's possible that the compiler on windows searches in system searchpath (path-variable), too.

Quote from cpp-manual:
Quote
#include <file>
    This variant is used for system header files. It searches for a file named file in a standard list of system directories. You can prepend directories to this list with the -I option (see Invocation).
#include "file"
    This variant is used for header files of your own program. It searches for a file named file first in the directory containing the current file, then in the quote directories and then the same directories used for <file>. You can prepend directories to the list of quote directories with the -iquote option.

Offline rhf

  • Multiple posting newcomer
  • *
  • Posts: 123
Re: Is it a bug or a feature?
« Reply #4 on: November 15, 2008, 05:06:34 pm »
Jens,

Thanks for your ideas. These caused me to remember something that I recently changed, which is apparently related to the problem.

In the past, I always placed the directory for my library headers in my Project build options- > Search directories.
A couple of weeks back, I moved this directory to my Global compiler settings -> Search directories.
Using the global settings is convenient, but with this setup I definitely have the problem that I describe above.

When I move the headers directory back to the Project build options- > Search directories, the Build process now operates correctly.

Now that I know what the problem is, I can easily avoid it.
It is quite possible that I am doing something wrong, but there sure seems to be a bug somewhere related to the Global search directories.


Max

  • Guest
Re: Is it a bug or a feature?
« Reply #5 on: November 16, 2008, 10:30:03 am »
brackets are used on 'library headers' which is generally assumed to be something that doesnt change.  quotation marks are generally used for project headers.  So this is more an optimization (feature) and not a bug.

I have a project to build a static library, say libfoo.a. The header files of that projects are including other headers of the libfoo.a's projects.
I can use "" during development but once library and header are installed
in the system they become "system" header, so the "" becomes wrong, I shuold use <> !!

Ok, so in this case what should I do?

It do believe that the ".depends" must works for both <> and "".

Thx

Max