aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr105635-2.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2023-12-01 08:10:13 +0100
committerFlorian Weimer <fweimer@redhat.com>2023-12-01 08:10:13 +0100
commit4ecfa6c4a9df19b364cbdf6d9de5f0b98c22bd8f (patch)
tree82fe02902283e386b142cbc9fa298202921f9b63 /gcc/testsuite/gcc.dg/pr105635-2.c
parent3ae8882e70ad3c33b7a27a8e521dca6c1d434f74 (diff)
downloadgcc-4ecfa6c4a9df19b364cbdf6d9de5f0b98c22bd8f.zip
gcc-4ecfa6c4a9df19b364cbdf6d9de5f0b98c22bd8f.tar.gz
gcc-4ecfa6c4a9df19b364cbdf6d9de5f0b98c22bd8f.tar.bz2
c: Turn -Wreturn-mismatch into a permerror
gcc/ * doc/invoke.texi (Warning Options): Document that -Wreturn-mismatch is a permerror in C99 and later. gcc/c/ PR c/96284 * c-typeck.cc (c_finish_return): Use permerrors for OPT_Wreturn_mismatch diagnostics. gcc/testsuite/ * gcc.dg/permerror-default.c (return_mismatch_1) (return_mismatch_2): Expect new permerror. * gcc.dg/permerror-gnu89-nopermissive.c (return_mismatch_1): Likewise. * gcc.dg/permerror-system.c: Likewise. * gcc.dg/20030906-1.c: Compile with -fpermissive due to expected -Wreturn-mismatch error. * gcc.dg/20030906-1a.c: New test. Copied from gcc.dg/20030906-1.c. Expect the error. * gcc.dg/20030906-2.c: Compile with -fpermissive due to expected -Wreturn-mismatch error. * gcc.dg/20030906-2a.c: New test. Copied from gcc.dg/20030906-2.c. Expect the error. * gcc.dg/Wreturn-mismatch-1.c: Compile with -fpermissive due to expected -Wreturn-mismatch error. * gcc.dg/Wreturn-mismatch-1a.c: New test. Copied from gcc.dg/Wreturn-mismatch-1.c. Expect the error. * gcc.dg/Wreturn-mismatch-2.c: Compile with -fpermissive due to expected -Wreturn-mismatch error. * gcc.dg/Wreturn-mismatch-2a.c: New test. Copied from gcc.dg/Wreturn-mismatch-2.c. Expect the error. * gcc.dg/diagnostic-range-bad-return.c: Compile with -fpermissive due to expected -Wreturn-mismatch error. * gcc.dg/diagnostic-range-bad-return-2.c: New test. Copied from gcc.dg/diagnostic-range-bad-return.c. Expect the error. * gcc.dg/pr105635-2.c: Expect -Wreturn-mismatch error. * gcc.dg/pr23075.c: Build with -fpermissive due to expected -Wreturn-mismatch error. * gcc.dg/pr23075-2.c: New test. Copied from gcc.dg/pr23075.c. Expect the error. * gcc.dg/pr29521.c: Compile with -fpermissive due to expected -Wreturn-mismatch error. * gcc.dg/pr29521-a.c: New test. Copied from gcc.dg/pr29521.c. Expect error. * gcc.dg/pr67730.c: Compile with -fpermissive due to expected -Wreturn-mismatch error. * gcc.dg/pr67730-a.c: New test. Copied from gcc.dg/pr67730-a.c. Expect error. * gcc.target/powerpc/conditional-return.c: Compile with -fpermissive due to expected -Wreturn-mismatch error.
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr105635-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr105635-2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.dg/pr105635-2.c b/gcc/testsuite/gcc.dg/pr105635-2.c
index 807eef0..019dbc7 100644
--- a/gcc/testsuite/gcc.dg/pr105635-2.c
+++ b/gcc/testsuite/gcc.dg/pr105635-2.c
@@ -7,5 +7,5 @@ void foo (int, int[*]); /* { dg-message "previous declaration of 'foo' with type
foo (int x, int y) /* { dg-error "return type defaults to 'int'" } */
{ /* { dg-warning "conflicting types for 'foo'" "" { target *-*-* } .-1 } */
/* { dg-message "declared here" "" { target *-*-* } .-2 } */
- return (x >= 0) != (y < 0); /* { dg-warning "'return' with a value, in function returning void" } */
+ return (x >= 0) != (y < 0); /* { dg-error "'return' with a value, in function returning void" } */
}