Bug 66293 - Support -Weverything to enable all warnings
Summary: Support -Weverything to enable all warnings
Status: RESOLVED DUPLICATE of bug 31573
Alias: None
Product: gcc
Classification: Unclassified
Component: driver (show other bugs)
Version: 6.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-26 18:00 UTC by Sverd Johnsen
Modified: 2016-02-15 20:30 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sverd Johnsen 2015-05-26 18:00:47 UTC
clang supports -Weverything which simply enables all warnings. gcc should introduce an equivalent option.
Comment 1 Jonathan Wakely 2015-05-26 19:35:48 UTC
(In reply to Sverd Johnsen from comment #0)
> clang supports -Weverything which simply enables all warnings. gcc should
> introduce an equivalent option.

No it shouldn't.

This is a dup of an existing bug, but basically most clang devs I've spoken to say -Weverything is a bad idea, it exists only for testing/debugging clang itself and for an IDE to query all the available warning flags programmatically, and is not a feature we should copy.

Do not want.
Comment 2 Jonathan Wakely 2015-05-26 19:38:09 UTC
It's PR31573 and its duplicate.

*** This bug has been marked as a duplicate of bug 31573 ***
Comment 3 Jean-Michaël Celerier 2016-02-15 16:56:55 UTC
As a Clang user, -Weverything allowed me to remove terrible bugs that would not crop up with -Wall -Wextra -Wfew-other-common-warnings.

For instance GCC 6 brings in many new warnings it seems. Well, it is a pity to have to go through the manual to find the new warnings and enable them by hand (very few people will actually do this, while it could certainly make some bugs appear. Maybe it could prevent the next Heartbleed ?).
Comment 4 Martin Sebor 2016-02-15 18:52:16 UTC
In my experience, options like -Weverything tend to be too noisy to be generally useful for projects of non-trivial size.

At the same time, I would find an option like -Weverything quite useful when debugging GCC's support for diagnostics.  I use -Wall -Wextra -Wpedantic but there are some warnings that aren't enabled even with these three.  That said, if -Weverything were to be provided, it wouldn't be able to enable every single diagnostic because some are mutually exclusive (for example, the -Wabi=version warnings for distinct ABI versions).  It also wouldn't be guaranteed to enable diagnostics controlled by non-warning options.  But I wouldn't view these limitations as reasons not to provide such a feature.  Many other popular compilers  besides Clang provide it.  Below are examples of a few other implementations that do:

EDG eccp has --remarks to enable informational diagnostics that are normally disabled.
HP aCC has +w that if memory serves enables all warnings (including EDG remarks, since aCC uses the EDG front end).
IBM XLC/C++ has -qinfo=all.
Intel ICC has a -diag-enable= option similar to XLC/C++ -qinfo= (ICC also uses the EDG front end but has many more diagnostics).
Oracle CC has the -erroff=%none option that (IIRC) enables all warnings.
Microsoft Visual C++ has /Wall that's documented to enable all diagnostic.
Comment 5 Jean-Michaël Celerier 2016-02-15 20:30:30 UTC
> In my experience, options like -Weverything tend to be too noisy to be generally useful for projects of non-trivial size.

It's always possible to run -Weverything -Wno-foo -Wno-bar to remove unwanted warnings. It's a bit more work upfront, but will bring benefits at each compiler update. Generally speaking, I'd say that there are more "useful" than "useless" warnings, hence it's less work to disable the useless ones, than to enable the useful ones.