This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [CPP patch]: -M default name


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]