public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marek Polacek <polacek@redhat.com>
To: "James K. Lowden" <jklowden@schemamania.org>
Cc: gcc@gcc.gnu.org
Subject: Re: passing command-line arguments, still
Date: Thu, 17 Mar 2022 15:16:23 -0400	[thread overview]
Message-ID: <YjOJB6wVO2DngrKa@redhat.com> (raw)
In-Reply-To: <20220317122136.d15c4fd4f6ea9fec2cbc0938@schemamania.org>

On Thu, Mar 17, 2022 at 12:21:36PM -0400, James K. Lowden wrote:
> On Wed, 16 Mar 2022 14:45:33 -0400
> Marek Polacek <polacek@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?

I think Jon and Joseph answered your questions now.
 
> It's my understanding that the -f prefix indicates a switch, meaning:  
> 
> 1.  It does not take an argument

It may, as Jon showed.

> 2.  GCC accepts a  -fno- alternative, automatically

Right, unless it's RejectNegative.

> 3.  The "f" stands for "flag", meaning on/off.  

It does stand for "flag", and it looks like at some point in ancient
history if was on/off, but then came options like -falign-loops=N.
 
> 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?  

I guess that you'd have two separate entries in whatever.opt:

ffoo
...

fno-foo
...

> More accurate would be
> to say a "fno-" form is automatically accepted or generated. Computer
> code does not make assumptions; programmers do.  

TBH, I don't see how that would be any more accurate that what we have now.


Anyway, did you figure it out or are there some lingering questions?

Marek


      parent reply	other threads:[~2022-03-17 19:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16 18:34 James K. Lowden
2022-03-16 18:45 ` Marek Polacek
2022-03-17 16:21   ` James K. Lowden
2022-03-17 17:39     ` Jonathan Wakely
2022-03-19 17:10       ` James K. Lowden
2022-03-19 17:53         ` David Edelsohn
2022-03-21 10:19           ` Jonathan Wakely
2022-03-21 10:21         ` Jonathan Wakely
2022-03-17 18:37     ` Joseph Myers
2022-03-17 19:16     ` Marek Polacek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YjOJB6wVO2DngrKa@redhat.com \
    --to=polacek@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=jklowden@schemamania.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).