[cfe-commits] r139551 - /cfe/trunk/include/clang/Driver/Options.td

Joerg Sonnenberger joerg at britannica.bec.de
Wed Sep 14 02:58:46 PDT 2011


On Tue, Sep 13, 2011 at 01:00:17PM -0700, Chad Rosier wrote:
> 
> On Sep 13, 2011, at 3:43 AM, Joerg Sonnenberger wrote:
> 
> > On Mon, Sep 12, 2011 at 10:43:01PM -0000, Chad Rosier wrote:
> >> Author: mcrosier
> >> Date: Mon Sep 12 17:43:01 2011
> >> New Revision: 139551
> >> 
> >> URL: http://llvm.org/viewvc/llvm-project?rev=139551&view=rev
> >> Log:
> >> [driver] Ignore the '--' option, rather then fail. Do so to match gcc's 
> >> behavior.
> >> rdar://10110352 and PR10908
> > 
> > I don't think this is a good idea. It violates POLA. Proper behavior
> > would at the very least ignore it silently. I'd suggest to start by
> > reverting this and committing some like the attached patch. It still
> > doesn't handle input file names starting with - (e.g. -c.c) correctly,
> > but that's a question of passing down the input correctly to internal
> > tools.
> 
> gcc emitting a warning as well.
> 
> rosier:llvm-clean mcrosier$ gcc -- test.c
> llvm-gcc-4.2: ambiguous abbreviation --
> 
> Thus, I didn't silence the warning for compatibility reasons.

That's even more stupid. It sounds like a bug in the getopt
implementation and not a feature. So yes, I maintain that this behavior
is wrong and that compatibility with GCC should be considered a
non-issue here.

Joerg



More information about the cfe-commits mailing list