Subject: toolchain/23300: cpp(1) gives bad advice about #error
To: None <gnats-bugs@gnats.netbsd.org>
From: Jim Wise <jwise@draga.com>
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
>Closed-Date:
>Last-Modified:
>Originator:     Jim Wise
>Release:        NetBSD 1.6Y
>Organization:
				Jim Wise
				jwise@draga.com
>Environment:
System: NetBSD himring.draga.com 1.6Y NetBSD 1.6Y (HIMRING2-1.569) #0: Thu Sep 4 23:13:59 EDT 2003 root@himring.draga.com:/home/NetBSD/build/obj/i386/sys/arch/i386/compile/HIMRING2 i386
Architecture: i386
Machine: i386
>Description:
	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
	intention.

>How-To-Repeat:
	Use #error with gcc 3.3 and -Wtraditional.
>Fix:
	Consider the test at line 332 of src/gnu/dist/gcc/gcc/cpplib.c .
>Release-Note:
>Audit-Trail:
>Unformatted: