On Wed, 16 Mar 2022 14:45:33 -0400
Marek Polacek <pola...@redhat.com> wrote:

Hi Marek, 

> Let's avoid -f-foo; use -ffoo instead, like the rest of GCC.

Sure. I hadn't noticed the distinction. 

> > In cobol/lang.opt, I have:
> > 
> > indicator-column
> 
> Make this 'findicator-column='.  Does that help?

Yes, with that change, the option & argument are passed.  But ... why?

It's my understanding that the -f prefix indicates a switch, meaning:  

1.  It does not take an argument
2.  GCC accepts a  -fno- alternative, automatically
3.  The "f" stands for "flag", meaning on/off.  

My option has no alternative, if you'll pardon the pun.  I don't see
the point in confusing the user by suggesting it does.  

The fine manual says:

     By default, all options beginning with "f", "W" or "m" are
     implicitly assumed to take a "no-" form.  This form should not be
     listed separately.  If an option beginning with one of these
     letters does not have a "no-" form, you can use the
     'RejectNegative' property to reject it.

That isn't quite accurate.  The "no-" form isn't "implicitly assumed".
What would "explicitly assumed" look like, btw?  More accurate would be
to say a "fno-" form is automatically accepted or generated. Computer
code does not make assumptions; programmers do.  

Elsewhere: 

   * An option definition record.  These records have the following
     fields:
       1. the name of the option, with the leading "-" removed
       2. a space-separated list of option properties (*note Option
          properties::)
       3. the help text to use for '--help' (omitted if the second field
          contains the 'Undocumented' property).

Nowhere is it suggested that options that take arguments should have a
leading "f" or trailing "=".  

The *name* of the option doesn't include "="; it can be invoked Joined
or Separate.  Why does adding the "=" even work?  

> doc/options.texi describes options relative well, I think.

That's good to know; at least you're not telling me it's horribly out
of date.  I am puzzled, though, because AFAICT that document doen't
indicate why a leading "f" or trailing "=" controls whether or not an
option taking an argument is passed to the compiler. 

Regards, 

--jkl

Reply via email to