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

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vries at gcc dot gnu.org

--- Comment #12 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Dmitry G. Dyachenko from comment #0)
> -fsanitize={address,undefined} unaffected

FWIW, I've run into this with -fsanitize=address and gcc 7.3 (minimized from
gdb/gdbtypes.c):
...
$ cat test.c 
struct i
{
  unsigned int i;
};
typedef struct i si;
extern const si const1;
extern const si const2;

si
foo (int c, int d)
{
  si var = { 0 };

  switch (c)
    {
    case 1:
      switch (d)
        {
        case 2:
          return var;
        default:
          return const1;
        }
      break;
    default:
      return const2;
    }
}
$ g++-7 -O0 test.c -c -Wreturn-type -fsanitize=address
test.c: In function ‘si foo(int, int)’:
test.c:28:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
$ g++-7 -O0 test.c -c -Wreturn-type
$
...

Reply via email to