Bug 39646 - __FILE__ breaks for empty file name
Summary: __FILE__ breaks for empty file name
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: preprocessor (show other bugs)
Version: 4.1.3
: P3 normal
Target Milestone: 4.5.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: 16989 16620
  Show dependency treegraph
 
Reported: 2009-04-05 13:05 UTC by Neil Booth
Modified: 2009-04-18 17:37 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 4.5.0
Known to fail:
Last reconfirmed: 2009-04-08 16:07:35


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Neil Booth 2009-04-05 13:05:39 UTC
GCC rejects the following strictly conforming TU with -pedantic-errors

extern int x;

#line 24 ""
extern char z[sizeof __FILE__ == 1];
Comment 1 Joseph S. Myers 2009-04-18 17:36:40 UTC
Subject: Bug 39646

Author: jsm28
Date: Sat Apr 18 17:36:28 2009
New Revision: 146319

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146319
Log:
libcpp:
	PR preprocessor/39646
	* include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
	* line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
	* directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
	place of LC_RENAME.

gcc/testsuite:
	* gcc.dg/cpp/line8.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/cpp/line8.c
Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/libcpp/ChangeLog
    trunk/libcpp/directives.c
    trunk/libcpp/include/line-map.h
    trunk/libcpp/line-map.c

Comment 2 Joseph S. Myers 2009-04-18 17:37:57 UTC
Fixed for 4.5.