[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: depcomp deficiency [was: m4-1.4.7 build feedback]

From: Joseph S. Myers
Subject: Re: depcomp deficiency [was: m4-1.4.7 build feedback]
Date: Thu, 28 Sep 2006 12:15:05 +0000 (UTC)

On Thu, 28 Sep 2006, Nelson H. F. Beebe wrote:

> The gcc folks could probably argue that -- is indeed ambiguous,
> because there is no way to tell which of the following arguments are
> intended for the preprocessor, the compiler, the assembler, or the
> linker.  There are already -W[x],-option,value options to direct
> arguments to specific components.

It's not ambiguous; the following arguments should all be treated as input 
files, not options, and whether the input files are compiled (and as what 
language) or linked is determined by their suffixes in the documented 
manner.  Thus

    gcc -- -foo.c -lbar

should compile the C source file "-foo.c" and link the resulting object 
with the object file called "-lbar" (not with the library libbar.a).  
This does require passing the "--" through to the linker (and I don't know 
if the linker supports -- as would be required), or rewriting the command 
as the equivalent

    gcc ./-foo.c ./-lbar

Joseph S. Myers

reply via email to

[Prev in Thread] Current Thread [Next in Thread]