[Bug preprocessor/64965] __FILE__ doesn't work if the filename contains newline

rv at rasmusvillemoes dot dk gcc-bugzilla@gcc.gnu.org
Sat Feb 7 16:49:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64965

Rasmus Villemoes <rv at rasmusvillemoes dot dk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor

--- Comment #2 from Rasmus Villemoes <rv at rasmusvillemoes dot dk> ---
(In reply to Rasmus Villemoes from comment #1)
> Created attachment 34693 [details]
> Make __FILE__ work for filenames containing newline

This seems to fix the reported problem as well as a related one: gcc -E
produces broken output for such files.

I'm not sure about the remaining users of cpp_quote_string (in particular, I
know nothing about fortran).

Creating a testcase or two is a little awkward, as that would mean creating
files with weird characters in the repository, and I'm not sure that's a good
idea. Also I have no idea if all filesystems even support such files.



More information about the Gcc-bugs mailing list