Subject: bin/11843: most uses of -idirafter in NetBSD sources are 'iffy'.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <cgd@netbsd.org>
List: netbsd-bugs
Date: 12/29/2000 18:12:17
>Number:         11843
>Category:       bin
>Synopsis:       most uses of -idirafter in NetBSD sources are 'iffy'.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 29 18:12:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Chris Demetriou
>Release:        NetBSD-current as of 2000-12-29
>Organization:
>Environment:
NetBSD sources as above (some slightly older), with a GCC from
development sources as of a month or two ago (but source
compiler source code eyeball-compared in a few relevant
places against the current source).
>Description:
Most uses of -idirafter in the NetBSD sources are 'iffy'.

-idirafter is used to indicate the system include path, in
various places where DESTDIR builds are used.

-idirafter is inconsistently documented.  The manual page (never
canonical for gcc! 8-) says one thing, 'gcc -v -help' says
another, but the info files (the canonical gcc documentation)
simply says that '-idirafter' adds to the 'second' include path.

-isystem is used to add directories to the system include path.

It would appear that in the version of gcc that we supply, the second
include path is treated as a system include path, i.e. warnings
are suppressed if generated by those includes.  This does not
appear to be the case with the current GCC development sources, and
therefore warnings are produced and -Werror causes death.

>How-To-Repeat:
DESTDIR compile NetBSD sources with current-ish GCC bits.
>Fix:
replace broken uses of -idirafter, and add mention of -isystem where
appropriate.  A quick grep of almost-current sources makes me think
that the uses in the following files (relative to src) need to have
-idirafter changed to -isystem:

./lib/libc/sys/Makefile.inc
./lib/libc/Makefile
./lib/libcompat/Makefile
./lib/libposix/Makefile
./usr.bin/kdump/mkioctls
./usr.bin/xlint/xlint/xlint.c
./share/mk/bsd.sys.mk
./sys/arch/x68k/stand/libiocs/Makefile

and the following file to have -isystem added where -idirafter is supported:

./gnu/usr.bin/egcs/cpp/usr.bin.cpp.sh
>Release-Note:
>Audit-Trail:
>Unformatted: