preprocessor/2565: mention in #line precludes later #include

gmt@cs.arizona.edu gmt@cs.arizona.edu
Mon Apr 16 18:36:00 GMT 2001


>Number:         2565
>Category:       preprocessor
>Synopsis:       mention in #line precludes later #include
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 16 18:36:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Gregg Townsend
>Release:        gcc version 2.96 20000731 (Red Hat Linux 7.0)
>Organization:
>Environment:
Red Hat 7.0, Intel
>Description:
If a file is mentioned by a #line directive
in a C source file, it cannot be later referenced
by an #include directive.  The diagnostic is:
   foo.h:3:17: foo.h: No such file or directory

This artificial test case was reduced down from
a much more sensible real application.  It compiled
properly with
   gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
>How-To-Repeat:
touch foo.h    (to create an empty file for inclusion)
gcc -E foo.c
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="foo.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="foo.c"

I2xpbmUgMyAiZm9vLmgiCiNpbmNsdWRlICJmb28uaCIKaW50IG1haW4oaW50IGFyZ2MsIGNoYXIg
KmFyZ3ZbXSkgeyByZXR1cm4gMDsgfQo=



More information about the Gcc-bugs mailing list