On Wed, May 10, 2023 at 7:28 PM Jonathan Wakely via Gcc <gcc@gcc.gnu.org> wrote:
> On Thu, 11 May 2023 at 00:18, James K. Lowden <jklow...@schemamania.org> 
> wrote:
> >
> > On Tue, 9 May 2023 23:45:50 +0100
> > Jonathan Wakely via Gcc <gcc@gcc.gnu.org> wrote:

> Technically, the standard only requires a diagnostic, and a warning is
> a diagnostic. So strictly speaking, it's conforming to let them pass
> with a warning. The question is whether that's really the best
> behaviour for the majority of current users. At some point in the past
> it was decided that warning and continuing by default was the best
> choice. That might not still be true today.

Indeed.  We have an assortment of levels of diagnostic.

error: always causes compilation to fail
   These are constructs for which either there's no reasonable
interpretation or no perceived benefit to accepting the code.

permerror: causes compilation to fail without -fpermissive
   Ill-formed constructs that we want to prevent in new code, but want
to allow in legacy code.

pedwarn on by default: warning by default, error with -pedantic-errors
   Ill-formed constructs that we think new code shouldn't use but are
ok to allow with a warning.

conditional pedwarn: warning with -pedantic, error with -pedantic-errors
   Ill-formed constructs that we support as an extension.

warnings on by default
  Patterns that are well-formed but almost certainly a mistake.

warnings in -Wall
  Patterns that are very likely a mistake.

warnings in -Wextra
  Patterns that are likely a mistake.

warnings you have to enable specifically
  Patterns that you want help to avoid.

Particular diagnostics can move between categories as perceptions
change over time.  My understanding of the proposal is that it
proposes to move these particular diagnostics from category 3 up to
category 2, both because code that relies on these patterns has gotten
less common and using these patterns by mistake has gotten more
harmful.

Jason

Reply via email to