This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/7070: internal error with -Wunknown-pragmas && empty #pragma
- From: ms at siroyan dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 18 Jun 2002 16:49:45 -0000
- Subject: c/7070: internal error with -Wunknown-pragmas && empty #pragma
- Reply-to: ms at siroyan dot com
>Number: 7070
>Category: c
>Synopsis: internal error with -Wunknown-pragmas && empty #pragma
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Tue Jun 18 09:56:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Marcus Shawcroft
>Release: 3.1
>Organization:
>Environment:
redhat 7.1 i686
>Description:
The -Wunknown-pragmas option doesn;t like empty #pragma's.
Try this on the attached file:
gcc -Wall x.c
Gives:
internal error: x.c:1:8: unspellable token CPP_EOF
>How-To-Repeat:
>Fix:
*** /project/vobtags/toolsdev/gcc/gcc/gcc/c-lex.c@@/main/Integration.5410/Integration.6110/ms_toolsdev/0 Tue Jun 18 17:27:17 2002
--- c-lex.c Tue Jun 18 17:27:54 2002
***************
*** 338,348 ****
const cpp_token *s;
s = cpp_get_token (pfile);
- space = cpp_token_as_text (pfile, s);
- s = cpp_get_token (pfile);
if (s->type == CPP_NAME)
! name = cpp_token_as_text (pfile, s);
!
lineno = SOURCE_LINE (map, line);
if (name)
warning ("ignoring #pragma %s %s", space, name);
--- 338,350 ----
const cpp_token *s;
s = cpp_get_token (pfile);
if (s->type == CPP_NAME)
! {
! space = cpp_token_as_text (pfile, s);
! s = cpp_get_token (pfile);
! if (s->type == CPP_NAME)
! name = cpp_token_as_text (pfile, s);
! }
lineno = SOURCE_LINE (map, line);
if (name)
warning ("ignoring #pragma %s %s", space, name);
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="x.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="x.c"
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQKbWFpbiAoaW50IGFyZ2MsIGNoYXIgKmFyZ3ZbXSkKewog
IHByaW50ZiAoIkhlbGxvIFdvcmxkXG4iKTsKfQo=