view gcc/testsuite/gcc.dg/pr29521-2.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900 (2020-05-25)
parents 04ced10e8804
children
line wrap: on
line source
/* PR 29521 : warning for return with expression in function returning void */
/* { dg-do compile } */
/* { dg-options "-pedantic-errors" } */

void func (void) { }

void func2 (void)
{
  return func (); /* { dg-error "ISO C forbids 'return' with expression" } */
}

void func3 (void)
{
  return 1; /* { dg-error "'return' with a value" } */
}