https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63670
Bug ID: 63670
Summary: Ending C_INCLUDE_PATH with a trailing colon broken
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: preprocessor
Assignee: unassigned at gcc dot gnu.org
Reporter: nightstrike at gmail dot com
If the C_INCLUDE_PATH environment variable ends with a colon, which can happen
with typical "prepend" scripts of the form:
C_INCLUDE_PATH=/path:$C_INCLUDE_PATH
then gcc will treat every file included with <> instead of "" as being a system
header, and will not generate any warnings. The following is a test case that
I have been using, as I got burned on a bug from not seeing the warning that
set me back several days:
a.c:
int f() {}
b.c:
#include <a.c>
Expected output:
$ gcc b.c -Wall
./a.c: In function âfâ:
./a.c:1:1: warning: control reaches end of non-void function [-Wreturn-type]
int f() {}
^
However:
$ export C_INCLUDE_PATH=:
$ gcc b.c -Wall
** No output **