This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: cpp mishandles \ in filenames
- From: mike stump <mrs at windriver dot com>
- To: zack at codesourcery dot com
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 10 Jan 2002 19:11:53 -0800 (PST)
- Subject: Re: cpp mishandles \ in filenames
> Date: Thu, 10 Jan 2002 16:49:56 -0800
> To: mike stump <mrs@windriver.com>
> Cc: gcc-bugs@gcc.gnu.org
> From: Zack Weinberg <zack@codesourcery.com>
> On Thu, Jan 10, 2002 at 04:19:58PM -0800, mike stump wrote:
> > Someone broke filenames with \ in them when they turned on the new
> > preprocessor. This used to work exactly this way in the old
> > preprocessor. This restores the functionality. Without this windows
> > hosted tools with native filenames are completely screwed.
> The "string constant" on a #-line is interpreted the same way as a
> double-quote include, i.e. \ escapes are *not* interpreted. Try
> your test again with -S -save-temps, you will see that the proper
> .file string appears in the assembly output.
> I do not see what else you could mean by "mishandles \ in filenames."
Ah, I get it, someone changed the the various semantics of #, and
quoting and what not, and wound up fixing the `bug' that was
introduced in a completely different place, instead of preserving the
existing interfaces of the compiler.
:-( Ah, oh well.
Never mind.
The only difference is that now, this fails:
$ echo 'int i;' > 't
"f.c'
$ gcc -E 't
"f.c'
# 1 "t
"f.c"
int i;
$ gcc -c 't
"f.c'
/usr/ccs/bin/as: "/var/tmp//ccZCsycb.s", line 1: error: unterminated string
/usr/ccs/bin/as: "/var/tmp//ccZCsycb.s", line 2: error: unterminated string
/usr/ccs/bin/as: "/var/tmp//ccZCsycb.s", line 2: error: statement syntax
$
whereas, before, it didn't. Also, before we could preserve all sorts
of funny characters in filenames more trivially through the assembly
process, now, not sure if we can.
Before, this would have worked just fine, now it doesn't.