From: Nathan Sidwell <nathan@acm.org>
To: Jonathan Wakely <jwakely@redhat.com>, gcc@gcc.gnu.org
Subject: Re: Documentation style for options with optional levels
Date: Wed, 10 Apr 2019 12:42:00 -0000 [thread overview]
Message-ID: <4edf0321-0eae-0145-5327-3a54a202816b@acm.org> (raw)
In-Reply-To: <20190410111326.GF943@redhat.com>
On 4/10/19 7:13 AM, Jonathan Wakely wrote:
> For options that can be used as -foo or -foo=level we have a variety
> of different styels for documenting what the default level is. See
> below for several examples. I find this a bit confusing when try to
> see what it means to use the option without a level.
>
> Do we want to pick a style and try to be consistent?
yes?
All the examples you give leave something to be desired.
> For -Wformat-overflow we show the option with and without the level:
>
> Â @item -Wformat-overflow
> Â @itemx -Wformat-overflow=1
> Â @opindex Wformat-overflow
> Â @opindex Wno-format-overflow
> Â Level @var{1} of @option{-Wformat-overflow} enabled by @option{-Wformat}
The @item is the clearest to read, and also the most accurate as it
shows you can provide it without a level. But from that snippet there's
no indication what not giving a level gets you. There needs to be some
words somewhere to say what it maps to.
> For -Wshift-overflow we use prose to say what omitting the level
> means:
>
> Â @item -Wshift-overflow=1
> Â This is the warning level of @option{-Wshift-overflow} and is enabled
> Â by default in C99 and C++11 modes (and newer).
.. for example that, I can't tell if I can say just -Wshift-overflow and
get level 1, or if I'll get level 1 whatever unless I say
-Wno-shift-overflow
> For -Warray-bounds we list both options separately, and then also list
> the forms with levels and say what no level means:
>
> Â @item -Warray-bounds
> Â @itemx -Warray-bounds=@var{n}
> Â @opindex Wno-array-bounds
> Â @opindex Warray-bounds
> Â This option is only active when @option{-ftree-vrp} is active
> Â (default for @option{-O2} and above). It warns about subscripts to arrays
> Â that are always out of bounds. This warning is enabled by @option{-Wall}.
>
> Â @table @gcctabopt
> Â @item -Warray-bounds=1
> Â This is the warning level of @option{-Warray-bounds} and is enabled
> Â by @option{-Wall}; higher levels are not, and must be explicitly
> requested.
In context with the other levels, I see that is trying to tell you that
1 is the default, but it's unclear. My first reading was that 1 gets
you a warning level, (with the implication that 2 got you an error level
or something?)
nathan
--
Nathan Sidwell
next prev parent reply other threads:[~2019-04-10 12:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-10 11:13 Jonathan Wakely
2019-04-10 12:42 ` Nathan Sidwell [this message]
2019-04-10 13:53 ` Jonathan Wakely
2019-04-10 15:46 ` Sandra Loosemore
2019-04-10 22:39 ` Martin Sebor
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=4edf0321-0eae-0145-5327-3a54a202816b@acm.org \
--to=nathan@acm.org \
--cc=gcc@gcc.gnu.org \
--cc=jwakely@redhat.com \
/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).