This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [CPP patch]: -M default name
- To: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Subject: Re: [CPP patch]: -M default name
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Wed, 07 Feb 2001 09:55:17 +0000
- CC: gcc-patches at gcc dot gnu dot org, Zack Weinberg <zackw at Stanford dot EDU>, Tom Tromey <tromey at cygnus dot com>
- Organization: Codesourcery LLC
- References: <3A7FD18F.26C2B71@codesourcery.com> <20010206190024.J3104@daikokuya.demon.co.uk>
Neil Booth wrote:
> bash-2.04$ gcc -MM /tmp/test.c
> /tmp/test.o: /tmp/test.c /tmp/test.h
> bash-2.04$
>
> I thought we should keep the path of the source file.
yes, but as Zack says, when compiling we'd drop the object file in .
not /tmp.
> 1) You should use libiberty's basename () function
ok.
> 2) You need to call basename () before scanning for the prefix, otherwise
> files with a "." in the name of the directory, such as our testsuite
> directories, will get mangled in the (unlikely) case of a file
> without an extension.
Good point - that's an existing bug :)
I'll produce an amended patch. Producing a zero length object file
when -o is given needs investigating too.
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org