HomePhabricator

build: quiet annoying warnings without adding new ones
63b3111f84daUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

build: quiet annoying warnings without adding new ones

Disabling warnings can be tricky, because doing so can cause a different
compiler to create new warnings about unsupported disable flags. Also, some
warnings don't surface until they're paired with another warning (gcc). For
example, adding "-Wno-foo" won't cause any trouble, but if there's a legitimate
warning emitted, the "unknown option -Wno-foo" will show up as well.

Work around this in 2 ways:

  1. When checking to see if -Wno-foo is supported, check for "-Wfoo" instead.
  2. Enable -Werror while checking 1.

If "-Werror -Wfoo" compiles, "-Wno-foo" is almost guaranteed to be supported.

-Werror itself is also checked. If that fails to compile by itself, it likely
means that the user added a flag that adds a warning. In that case, -Werror
won't be used while checking, and the build may be extra noisy. The user would
need to fix the bad input flag.

Also, silence 2 more additional warnings that can show up post-c++11.

Details

Provenance
Cory Fields <cory-nospam-@coryfields.com>Authored on Mar 9 2016, 21:45
deadalnixPushed on May 14 2017, 22:04
Parents
rABCe26b62093ae2: Merge #7933: Fix OOM when deserializing UTXO entries with invalid length
Branches
Unknown
Tags
Unknown

Event Timeline

Cory Fields <cory-nospam-@coryfields.com> committed rABC63b3111f84da: build: quiet annoying warnings without adding new ones (authored by Cory Fields <cory-nospam-@coryfields.com>).Apr 27 2016, 05:17