[Bug c++/100700] -Wreturn-type has many false positives

harald at gigawatt dot nl gcc-bugzilla@gcc.gnu.org
Fri May 21 16:51:19 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100700

Harald van Dijk <harald at gigawatt dot nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |harald at gigawatt dot nl

--- Comment #6 from Harald van Dijk <harald at gigawatt dot nl> ---
If the warning should mention -fstrict-enums, it should only do it in specific
cases:

enum E { A, B, C };

int h(E e) {
  switch (e) {
  case A: return 0;
  case B: return 0;
  case C: return 0;
  }
}

will still trigger the warning even with -fstrict-enums because now (E)3 is
valid.


More information about the Gcc-bugs mailing list