[Bug preprocessor/20356] New: New #include_next behaviour breaks limits.h

jakub at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Mar 7 08:56:00 GMT 2005


If some /usr/include header uses
#include "limits.h"
instead of
#include <limits.h>
it gets error: #include nested too deeply.
There are 2 limits.h headers, /usr/lib/gcc/*/*/include/limits.h and
/usr/include/limits.h that try to include each other with #include_next,
guarded with the defines that protect multiple header inclusion for the other
one.
" instead of < causes /usr/include/limits.h to be included first
(normally is /usr/lib/gcc/*/*/include/limits.h first) and this does:
#if defined __GNUC__ && !defined _GCC_LIMITS_H_
/* `_GCC_LIMITS_H_' is what GCC's file defines.  */
# include_next <limits.h>

In older GCC releases, this include_next would load the next limits.h in the
search path, which is /usr/lib/gcc/*/*/include/limits.h, but GCC4 includes
/usr/include/limits.h again (and does so until reaching the nesting limit).

-- 
           Summary: New #include_next behaviour breaks limits.h
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: preprocessor
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: *-linux


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



More information about the Gcc-bugs mailing list