[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

#pragma warnings are "invisible"



>Submitter-Id:  net
>Originator:    Petter Reinholdtsen
>Organization:  Hungry Programmers
>Confidential:  no
>Synopsis:      #pragma warnings are "invisible"
>Severity:      serious
>Priority:      low
>Category:      <choose from the top of this file (one line)>
>Class:         change-request
>Release:       3.0.2 20010825 (Debian prerelease) (Debian testing/unstable)
>Environment:
System: Linux zoot 2.4.6-686-smp #1 SMP Thu Jul 5 22:06:27 EST 2001 i686 unknownArchitecture: i686
 
        <machine, os, target, libraries (multiple lines)>
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux
>Description:

	We are compiling the same program using GCC, Compaq C++, SUN
	Forte and M$ Visual C++, and want to be able to insert
	'warnings' into the code in a common way.  At the moment all
	'common' code uses '#pragma WARNING("warning"), but these
	messages are not displayed when using gcc.  The GCC extention
	'#warning' is illegal on all the other compilers.  Would it be
	possible to change gcc to display the content of an unknown
	#pragma.  At the moment the following file (compiled with
	-Wall)

		#pragma WARNING "This is a pragma warning"
		#pragma WARNING("This is a pragma warning ()")
		#warning "This is a GNU C warning"

	produces the following messages:

		 pragmawarn.c:1: warning: ignoring #pragma WARNING
		 pragmawarn.c:2: warning: ignoring #pragma WARNING
		 pragmawarn.c:3:2: warning: #warning "This is a GNU C warning"

	Could this be changed to display the content of the pragma,
	for instance like this:

		 pragmawarn.c:1: warning: ignoring #pragma WARNING "This is a pragma warning"
		 pragmawarn.c:2: warning: ignoring #pragma WARNING("This is a pragma warning ()")
		 pragmawarn.c:3:2: warning: #warning "This is a GNU C warning"

	This would make GCC much more useful for our purpose.

	The Compaq C++ handle the warnings like this, and it works
	just fine for us. :-)

>How-To-Repeat:
        <When reporting a compiler error, preprocessor output must be included>
>Fix:
        <how to correct or work around the problem, if known (multiple lines)>



Reply to: