comparison gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 /* PR c/83656 - missing -Wbuiltin-declaration-mismatch on declaration
2 without prototype
3 { dg-do compile }
4 { dg-options "-Wall" } */
5
6 typedef __SIZE_TYPE__ size_t;
7
8 /* Verify that ordinary library built-ins are not diagnosed with -Wall
9 (or by default) whether or not they take arguments (even though they
10 should be). */
11
12 void abort ();
13 void* memcpy ();
14 void* memset ();
15 size_t strlen ();
16
17 /* Verify mismatches in return types are diagnosed. */
18 int exit (); /* { dg-warning "\\\[-Wbuiltin-declaration-mismatch]" } */
19
20 /* Variadic built-ins are diagnosed with -Wall (they are, in fact,
21 diagnosed by default). */
22 int printf (); /* { dg-warning "\\\[-Wbuiltin-declaration-mismatch]" } */
23 int sprintf (); /* { dg-warning "\\\[-Wbuiltin-declaration-mismatch]" } */