$ cat test.cpp #include <cstdlib> $ g++ -c -isystem /usr/include test.cpp In file included from test.cpp:1: /usr/include/c++/4.3/cstdlib:73:25: error: stdlib.h: No such file or directory ... This happens on two different system with 4.3.1 and 4.3.2. See also http://gcc.gnu.org/ml/gcc-help/2008-10/msg00338.html
appending -v shows /usr/lib64/gcc/x86_64-suse-linux/4.3/cc1plus -quiet -v -D_GNU_SOURCE t.C -quiet -dumpbase t.C -mtune=generic -auxbase t -version -o t.s #include "..." search starts here: #include <...> search starts here: /usr/include/c++/4.3 /usr/include/c++/4.3/x86_64-suse-linux /usr/include/c++/4.3/backward /usr/local/include /usr/lib64/gcc/x86_64-suse-linux/4.3/include /usr/lib64/gcc/x86_64-suse-linux/4.3/include-fixed /usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/include /usr/include End of search list. vs. /usr/lib64/gcc/x86_64-suse-linux/4.3/cc1plus -quiet -v -D_GNU_SOURCE -isystem /usr/include t.C -quiet -dumpbase t.C -mtune=generic -auxbase t -version -o t.s ignoring duplicate directory "/usr/include" #include "..." search starts here: #include <...> search starts here: /usr/include /usr/include/c++/4.3 /usr/include/c++/4.3/x86_64-suse-linux /usr/include/c++/4.3/backward /usr/local/include /usr/lib64/gcc/x86_64-suse-linux/4.3/include /usr/lib64/gcc/x86_64-suse-linux/4.3/include-fixed /usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/include End of search list. note the different ordering which will likely make #include_next fail? It works for me with 4.2.
The include_next doesn't make any sense in the cXXX headers, include_next is typically used when including the same header name, not when you are including unrelated header name, exactly because making assumptions whether it comes earlier or later in the search path is bad.
4.1.x used just #include, not #include_next in cstdio to include <stdio.h>, so I guess this is libstdc++-v3 regression, not driver.
I think the use of include_next started with Benjamin's patch of 2007-03-04, adding c_global. Benjamin, can you look into this issue? Otherwise, missing a solid rationale, for 4.4.0 I would just remove the uses, per Jakub' suggestion.
Subject: Re: [4.3/4.4 Regression] System header files not found once -isystem /usr/include is used Hmm, shouldn't the preprocessor just mark the include as a duplicate? Sent from my iPhone On Nov 12, 2008, at 8:50 AM, "paolo dot carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org > wrote: > > > -- > > paolo dot carlini at oracle dot com changed: > > What |Removed |Added > --- > --- > ---------------------------------------------------------------------- > AssignedTo|unassigned at gcc dot gnu |paolo dot carlini at > oracle > |dot org |dot com > Status|NEW |ASSIGNED > > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38000 >
Subject: Bug 38000 Author: paolo Date: Thu Nov 13 00:06:55 2008 New Revision: 141812 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141812 Log: 2008-11-13 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/38000 * include/c_global/csignal: Do not use include_next. * include/c_global/cstdlib: Likewise. * include/c_global/cstdio: Likewise. * include/c_global/cstdarg: Likewise. * include/c_global/cctype: Likewise. * include/c_global/cerrno: Likewise. * include/c_global/cmath: Likewise. * include/c_global/clocale: Likewise. * include/c_global/climits: Likewise. * include/c_global/cassert: Likewise. * include/c_global/csetjmp: Likewise. * include/c_global/cwchar: Likewise. * include/c_global/cfloat: Likewise. * include/c_global/cstdbool: Likewise. * include/c_global/cstring: Likewise. * include/c_global/cstddef: Likewise. * include/c_global/cwctype: Likewise. * include/tr1/cstdbool: Likewise. * include/tr1_impl/cinttypes: Do not include <inttypes.h>. * include/c_global/cinttypes: Do it here. * include/tr1/cinttypes: Likewise. * include/tr1_impl/cfenv: Do not include <fenv.h>. * include/c_global/cfenv: Do it here. * include/tr1/cfenv: Likewise. * include/tr1_impl/cstdint: Do not include <stdint.h>. * include/c_global/cstdint: Do it here. * include/tr1/cstdint: Likewise. * include/c_compatibility/fenv.h: Include <tr1_impl/cfenv>. * include/c_compatibility/stdint.h: Include <tr1_impl/cstdint>. * include/c_compatibility/inttypes.h: Include <tr1_impl/cinttypes>. * include/c_compatibility/math.h: Minor tweak, add comment. Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/include/c_compatibility/fenv.h trunk/libstdc++-v3/include/c_compatibility/inttypes.h trunk/libstdc++-v3/include/c_compatibility/math.h trunk/libstdc++-v3/include/c_compatibility/stdint.h trunk/libstdc++-v3/include/c_global/cassert trunk/libstdc++-v3/include/c_global/cctype trunk/libstdc++-v3/include/c_global/cerrno trunk/libstdc++-v3/include/c_global/cfenv trunk/libstdc++-v3/include/c_global/cfloat trunk/libstdc++-v3/include/c_global/cinttypes trunk/libstdc++-v3/include/c_global/climits trunk/libstdc++-v3/include/c_global/clocale trunk/libstdc++-v3/include/c_global/cmath trunk/libstdc++-v3/include/c_global/csetjmp trunk/libstdc++-v3/include/c_global/csignal trunk/libstdc++-v3/include/c_global/cstdarg trunk/libstdc++-v3/include/c_global/cstdbool trunk/libstdc++-v3/include/c_global/cstddef trunk/libstdc++-v3/include/c_global/cstdint trunk/libstdc++-v3/include/c_global/cstdio trunk/libstdc++-v3/include/c_global/cstdlib trunk/libstdc++-v3/include/c_global/cstring trunk/libstdc++-v3/include/c_global/ctime trunk/libstdc++-v3/include/c_global/cwchar trunk/libstdc++-v3/include/c_global/cwctype trunk/libstdc++-v3/include/tr1/cfenv trunk/libstdc++-v3/include/tr1/cinttypes trunk/libstdc++-v3/include/tr1/cstdbool trunk/libstdc++-v3/include/tr1/cstdint trunk/libstdc++-v3/include/tr1_impl/cfenv trunk/libstdc++-v3/include/tr1_impl/cinttypes trunk/libstdc++-v3/include/tr1_impl/cstdint
Fixed for 4.4.0.
Hey Paolo, what do you think about applying this patch to the gcc-4_3-branch and change the target milestone to 4.3.3, marking it FIXED? -benjamin
*** Bug 36505 has been marked as a duplicate of this bug. ***
Ok, I'll do the backport.
Subject: Bug 38000 Author: paolo Date: Fri Jan 9 00:00:17 2009 New Revision: 143194 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143194 Log: 2009-01-08 Paolo Carlini <paolo.carlini@oracle.com> Backport from mainline: 2008-11-13 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/38000 * include/c_global/csignal: Do not use include_next. * include/c_global/cstdlib: Likewise. * include/c_global/cstdio: Likewise. * include/c_global/cstdarg: Likewise. * include/c_global/cctype: Likewise. * include/c_global/cerrno: Likewise. * include/c_global/cmath: Likewise. * include/c_global/clocale: Likewise. * include/c_global/climits: Likewise. * include/c_global/cassert: Likewise. * include/c_global/csetjmp: Likewise. * include/c_global/cwchar: Likewise. * include/c_global/cfloat: Likewise. * include/c_global/cstdbool: Likewise. * include/c_global/cstring: Likewise. * include/c_global/cstddef: Likewise. * include/c_global/cwctype: Likewise. * include/tr1/cstdbool: Likewise. * include/tr1_impl/cinttypes: Do not include <inttypes.h>. * include/c_global/cinttypes: Do it here. * include/tr1/cinttypes: Likewise. * include/tr1_impl/cfenv: Do not include <fenv.h>. * include/c_global/cfenv: Do it here. * include/tr1/cfenv: Likewise. * include/tr1_impl/cstdint: Do not include <stdint.h>. * include/c_global/cstdint: Do it here. * include/tr1/cstdint: Likewise. * include/c_compatibility/fenv.h: Include <tr1_impl/cfenv>. * include/c_compatibility/stdint.h: Include <tr1_impl/cstdint>. * include/c_compatibility/inttypes.h: Include <tr1_impl/cinttypes>. * include/c_compatibility/math.h: Minor tweak, add comment. Modified: branches/gcc-4_3-branch/libstdc++-v3/ChangeLog branches/gcc-4_3-branch/libstdc++-v3/include/c_compatibility/fenv.h branches/gcc-4_3-branch/libstdc++-v3/include/c_compatibility/inttypes.h branches/gcc-4_3-branch/libstdc++-v3/include/c_compatibility/math.h branches/gcc-4_3-branch/libstdc++-v3/include/c_compatibility/stdint.h branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cassert branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cctype branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cerrno branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cfenv branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cfloat branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cinttypes branches/gcc-4_3-branch/libstdc++-v3/include/c_global/climits branches/gcc-4_3-branch/libstdc++-v3/include/c_global/clocale branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cmath branches/gcc-4_3-branch/libstdc++-v3/include/c_global/csetjmp branches/gcc-4_3-branch/libstdc++-v3/include/c_global/csignal branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cstdarg branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cstdbool branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cstddef branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cstdint branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cstdio branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cstdlib branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cstring branches/gcc-4_3-branch/libstdc++-v3/include/c_global/ctime branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cwchar branches/gcc-4_3-branch/libstdc++-v3/include/c_global/cwctype branches/gcc-4_3-branch/libstdc++-v3/include/tr1/cfenv branches/gcc-4_3-branch/libstdc++-v3/include/tr1/cinttypes branches/gcc-4_3-branch/libstdc++-v3/include/tr1/cstdbool branches/gcc-4_3-branch/libstdc++-v3/include/tr1/cstdint branches/gcc-4_3-branch/libstdc++-v3/include/tr1_impl/cfenv branches/gcc-4_3-branch/libstdc++-v3/include/tr1_impl/cinttypes branches/gcc-4_3-branch/libstdc++-v3/include/tr1_impl/cstdint
Fixed 4.3.3 too.