This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Change in pre-processor behavior with gcc-4.5.0


Hi,

I've just upgraded my system and as part of that upgrade I'm now using
gcc-4.5.0. One thing I've run into is a difference with the behaviour
of the C pre-processor between gcc-4.5.0 and gcc-4.3.3. With the
following silly program

  #include "does_not_exist.h"
  #define A_MACRO 'A'

  int main(int argc, char *argv)
  {
          putc(A_MACRO);
          return 0;
  }

cpp from gcc-4.5.0 gives

  # 1 "test.c"
  # 1 "<built-in>"
  # 1 "<command-line>"
  # 1 "test.c"
  test.c:1:28: fatal error: does_not_exist.h: No such file or directory
  compilation terminated.

while cpp from gcc-4.3.3 gives

  # 1 "test.c"
  # 1 "<built-in>"
  # 1 "<command-line>"
  # 1 "test.c"
  test.c:1:28: error: does_not_exist.h: No such file or directory


  int main(int argc, char *argv)
  {
   putc('A');
   return 0;
  }


We have one project that relies on the older (and probably broken)
behaviour which parses some source files looking for the result of one
particular macro expansion, at this stage it doesn't care about other
macro expansions - they will get handled when the code is compiled
properly. Is there anyway of making the pre-processor from gcc-4.5.0
keep going despite the missing header file?

Thanks,
Chris


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]