Bernd Schmidt <ber...@codesourcery.com> writes: > On 05/05/2011 11:53 PM, Ian Lance Taylor wrote: >> Jon Grant <j...@jguk.org> writes: >> >>> Is it expected that more than one -o option should be allowed by GCC >>> on command line? The later -o option overriding earlier. >> >> Yes, this is expected. Most Unix utilities behave that way: when an >> option with an argument is specified twice, and it only makes sense to >> specify it once, then the option argument which comes last is used. > > Huh. If you add -E to the command line you get > > cc1: error: output filename specified twice > > so we're a little inconsistent here.
Hmmm, you're right. I tend to think it is a bug to give an error here, but I don't feel strongly about it. The difference is that with -E the -o option is passed to cc1, whereas without it the -o option is passed to the assembler or the linker. The GNU assembler and linker both have the usual Unix behaviour of only using the last -o option. Ian