http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46444

           Summary: termination of preprocessing by cpp when no include
                    file is found
           Product: gcc
           Version: 4.4.5
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: igor.smir...@cern.ch


Hi,

This is likely a change rather than a true accidental bug, but this 
looks like a wrong change.

This relates to preprocessor, but I assume that cpp is considering as part of
gcc package?

The problem is that the cpp-preprocessor now terminates the treatment after the
first non-resolved include directive, when no file is found. This did not
happen in the past. This is first noticed by me at varsion gcc 4.4.5.

Still in version gcc 3.4.6 and numerous previous versions this did not happen.

The previous behaviour gave unique possibility to compile semi-preprocessed
source files with all local (project-dependent) header files included but
system-dependent files not included. After that a necessary set of include
directoves could be added in the beginning of this file (by hand or
automatically) and this file became compiled virtually at any computer.

An application program gathered into a single file by this way could be moved
between different computers, compiled freely at any of them (even not
necessarily Linux-based one) without installation of a whole set of
project-related libraries (which could be difficult).

This is impossible to do in this way after this change.
If the preprocessor does not ignore the absent system include files (which 
are made inavailable by -nostdinc -nostdinc++ options), but writes as error
diagnostics and quits, the project-dependent files cannot be gathered and
preprocessed, unless they are specially prepared, which is very difficult.

If there is no any option which make possible ignoring by CPP absent includes
(with possible issuing diagnostic),
I propose to add such an option or to return to previous behaviour, when absent
includes did not terminate cpp.

Regards
     Igor Smirnov

Reply via email to