Subject: toolchain/23300: cpp(1) gives bad advice about #error
To: None <>
From: Jim Wise <>
List: netbsd-bugs
Date: 10/28/2003 21:14:21
>Number:         23300
>Category:       toolchain
>Synopsis:       cpp(1) gives bad advice about #error
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 29 02:15:00 UTC 2003
>Originator:     Jim Wise
>Release:        NetBSD 1.6Y
				Jim Wise
System: NetBSD 1.6Y NetBSD 1.6Y (HIMRING2-1.569) #0: Thu Sep 4 23:13:59 EDT 2003 i386
Architecture: i386
Machine: i386
	Upon seeing a #error directive, with certain combinations of warning flags, gcc 3.3 warns:

		suggest hiding #%s from traditional C with an indented #

	this is, however, terribly bad advice.  Whereas an un`protected' #error fed to a traditional cpp
	will generate an error (albeit the wrong error) at the correct line, a `protected' #error will
	generate no error at all -- which is presumably much farther from the programmer's original

	Use #error with gcc 3.3 and -Wtraditional.
	Consider the test at line 332 of src/gnu/dist/gcc/gcc/cpplib.c .