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

unrecognized token before #include points to wrong source



>Submitter-Id:	net
>Originator:	Jim Bray <jb@cs.wcu.edu>
>Organization:	The Debian project
>Confidential:	no
>Synopsis:	unrecognized token before #include points to wrong source
>Severity:       non-critical
>Priority:       low
>Category:	preprocessor
>Class:		sw-bug
>Release:	3.0 (Debian GNU/Linux)
>Environment:
System: Debian GNU/Linux (testing/unstable)
Architecture: i686
	
host: i386-linux
build: i386-linux
target: i386-linux
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:
[ Reported to the Debian BTS as report #85908.
  Please CC 85908-quiet@bugs.debian.org on replies.
  Log of report can be found at http://bugs.debian.org/85908 ]
 	

unrecognized tokens before an include file point to the wrong file in
the error message.

--- begin
RandomGarbage
#include <stddef.h>

int main()
{
}
--- end

In file included from bug-85908.c:2:
/usr/lib/gcc-lib/i386-linux/3.0/include/stddef.h:147: syntax error before "typedef"

If there is more than one token ('Random Garbage'), the error message point to the correct position:

bug-85908.c:1: parse error before "Garbage"
In file included from bug-85908.c:2:
/usr/lib/gcc-lib/i386-linux/3.0/include/stddef.h:147: syntax error before "typedef"

So the bug submitter wants this message for exactly one unrecognized
token as well (point to the bug-85908.c file)

Preprocessed source is:

# 1 "bug-85908.c"
RandomGarbage
# 1 "/usr/lib/gcc-lib/i386-linux/3.0/include/stddef.h" 1 3
# 147 "/usr/lib/gcc-lib/i386-linux/3.0/include/stddef.h" 3
typedef int ptrdiff_t;
# 199 "/usr/lib/gcc-lib/i386-linux/3.0/include/stddef.h" 3
typedef unsigned int size_t;
# 287 "/usr/lib/gcc-lib/i386-linux/3.0/include/stddef.h" 3
typedef long int wchar_t;
# 3 "bug-85908.c" 2

int main()
{
}

>How-To-Repeat:
	
>Fix:
	



Reply to: