Bug 71283 - Inconsistent location for C++ warning options in the manual
Summary: Inconsistent location for C++ warning options in the manual
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 6.1.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: documentation, easyhack
: 87684 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-05-25 20:32 UTC by Eugene Zelenko
Modified: 2023-10-10 22:01 UTC (History)
10 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2016-05-26 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Zelenko 2016-05-25 20:32:59 UTC
-Wterminate description is missing in "Options to Request or Suppress Warnings".
Comment 1 Andrew Pinski 2016-05-25 20:35:43 UTC
index debd8ed..9c8aa99 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -2882,6 +2882,12 @@ Warn when overload resolution chooses a promotion from unsigned or
 enumerated type to a signed type, over a conversion to an unsigned type of
 the same size.  Previous versions of G++ tried to preserve
 unsignedness, but the standard mandates the current behavior.
+
+@item -Wno-terminate @r{(C++ and Objective-C++ only)}
+@opindex Wterminate
+@opindex Wno-terminate
+Disable the warning about a throw-expression that will immediately
+result in a call to @code{terminate}.
 @end table
Comment 2 Andrew Pinski 2016-05-25 20:37:40 UTC
That is because this is C++ only option.  It is listed under https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/C_002b_002b-Dialect-Options.html#C_002b_002b-Dialect-Options :

-Wno-terminate (C++ and Objective-C++ only)
Disable the warning about a throw-expression that will immediately result in a call to terminate.

This is exact location for all other C++ only options are located.

So not a bug.
Comment 3 Eric Gallager 2016-05-26 11:44:00 UTC
(In reply to Andrew Pinski from comment #2)
> That is because this is C++ only option.  It is listed under
> https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/C_002b_002b-Dialect-Options.
> html#C_002b_002b-Dialect-Options :
> 
> -Wno-terminate (C++ and Objective-C++ only)
> Disable the warning about a throw-expression that will immediately result in
> a call to terminate.
> 
> This is exact location for all other C++ only options are located.
> 
> So not a bug.

There are other C++-only options under "Options to Request or Suppress Warnings".
For example:
* -Wc++11-compat
* -Wc++14-compat
* -Wconditionally-supported
* -Wno-conversion-null
* -Wzero-as-null-pointer-constant
* -Wsubobject-linkage
* -Wdelete-incomplete
* -Wuseless-cast
* -Wsized-deallocation
* -Wno-invalid-offsetof

It's kind of inconsistent whether C++-only warnings are listed here or there.
Comment 4 Manuel López-Ibáñez 2016-05-26 17:25:21 UTC
(In reply to Eric Gallager from comment #3)
> There are other C++-only options under "Options to Request or Suppress
> Warnings".
> For example:
> * -Wc++11-compat
> * -Wc++14-compat
> * -Wconditionally-supported
> * -Wno-conversion-null
> * -Wzero-as-null-pointer-constant
> * -Wsubobject-linkage
> * -Wdelete-incomplete
> * -Wuseless-cast
> * -Wsized-deallocation
> * -Wno-invalid-offsetof
> 
> It's kind of inconsistent whether C++-only warnings are listed here or there.

The perfect solution would be to move the options documentation to the *.opt files where they are defined and auto-generate the corresponding parts of the *.texi files from the *.opt files. This way the documentation would be much more consistent. This is similar to what we already do for target-hooks: see gcc/target.def

That would be a very nice little project for a newbie.

The short-term solution is for someone to propose patches to move those to the correct place: https://gcc.gnu.org/wiki/GettingStarted#Basics:_Contributing_to_GCC_in_10_easy_steps
Comment 5 Eric Gallager 2018-04-05 00:57:59 UTC
Martin Sebor brought this up on the mailing lists here: https://gcc.gnu.org/ml/gcc/2018-04/msg00021.html
Comment 6 Martin Sebor 2018-04-05 20:58:28 UTC
I'm trying to fix this for GCC 8.
Comment 7 Eric Gallager 2018-07-05 04:33:21 UTC
(In reply to Martin Sebor from comment #6)
> I'm trying to fix this for GCC 8.

GCC 8 has been released. Deferred for GCC 9 then?
Comment 8 Jonathan Wakely 2018-10-22 09:28:25 UTC
*** Bug 87684 has been marked as a duplicate of this bug. ***
Comment 9 Jakub Jelinek 2019-05-03 09:18:19 UTC
GCC 9.1 has been released.
Comment 10 Jakub Jelinek 2019-08-12 08:57:55 UTC
GCC 9.2 has been released.
Comment 11 Eric Gallager 2020-03-01 15:17:56 UTC
Martin, did you want to stay the assignee for this? Sandra seemed to want to address this bug here: https://gcc.gnu.org/ml/gcc-patches/2020-02/msg01522.html
Comment 12 Martin Sebor 2020-03-02 18:23:03 UTC
I'm not working on this right now.
Comment 13 Jakub Jelinek 2020-03-12 11:58:52 UTC
GCC 9.3.0 has been released, adjusting target milestone.
Comment 14 Richard Biener 2021-06-01 08:08:01 UTC
GCC 9.4 is being released, retargeting bugs to GCC 9.5.
Comment 15 Eric Gallager 2021-07-01 08:07:43 UTC
@marxin: does your porting of GCC documentation to sphinx address this issue at all?
Comment 16 Martin Liška 2021-07-01 08:15:04 UTC
(In reply to Eric Gallager from comment #15)
> @marxin: does your porting of GCC documentation to sphinx address this issue
> at all?

If I see correctly, it's not addressed. The C++ options are listed at the following 2 pages:
https://splichal.eu/gccsphinx-final/html/gcc/gcc-command-options/options-controlling-c%2B%2B-dialect.html
https://splichal.eu/gccsphinx-final/html/gcc/gcc-command-options/options-to-request-or-suppress-warnings.html

What's new that I generated entry for e.g.:

-Wno-format
Default option value for -Wformat.
Comment 17 Barry Revzin 2022-03-04 17:56:50 UTC
(In reply to Andrew Pinski from comment #2)
> That is because this is C++ only option.  It is listed under
> https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/C_002b_002b-Dialect-Options.
> html#C_002b_002b-Dialect-Options :
> 
> -Wno-terminate (C++ and Objective-C++ only)
> Disable the warning about a throw-expression that will immediately result in
> a call to terminate.
> 
> This is exact location for all other C++ only options are located.
> 
> So not a bug.

Sure, but right now some warnings are under Warning Options and others are under Dialect Options. I would never think to look for warnings under dialect options, since my initial thought would be that the latter is for the kinds of things that show up first on that page... -fabi-version, -fchar8_t, etc. You have to go pretty far down that page to get to warnings. -Wsuggest-override used to be under Warning Options, was recently moved to Dialect Options for instance. 

I would like to request that either all the warning options are documented under warning options, or that there is one page for all the C++ warning options (as distinct from "dialect options"), or something else along those lines. The current split is a bit confusing and makes it hard to find warnings.
Comment 18 Eric Gallager 2023-10-10 20:29:25 UTC
Florian Weimer was wondering about this general issue (of inconsistency in location of documentation for common C/C++ options) on the mailing lists recently: https://gcc.gnu.org/pipermail/gcc/2023-October/242669.html