No empty .Rs/.Re
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / src / util / gccw.c
blobacdcfc509f3288e3e13be3412cbce4f31388b177
1 /* $NetBSD$ */
3 /*
4 * This is is a regression test for all the things that gcc is meant to warn
5 * about.
6 *
7 * gcc version 3 breaks several tests:
8 *
9 * -W does not report missing return value
11 * -Wunused does not report unused parameter
14 #include <stdio.h>
15 #include <setjmp.h>
17 jmp_buf jbuf;
19 /* -Wmissing-prototypes: no previous prototype for 'test1' */
20 /* -Wimplicit: return type defaults to `int' */
21 test1(void)
23 /* -Wunused: unused variable `foo' */
24 int foo;
26 /* -Wparentheses: suggest parentheses around && within || */
27 printf("%d\n", 1 && 2 || 3 && 4);
28 /* -W: statement with no effect */
30 /* BROKEN in gcc 3 */
31 /* -W: control reaches end of non-void function */
35 /* -W??????: unused parameter `foo' */
36 void test2(int foo)
38 enum {
39 a = 10, b = 15} moe;
40 int bar;
42 /* -Wuninitialized: 'bar' might be used uninitialized in this function */
43 /* -Wformat: format argument is not a pointer (arg 2) */
44 printf("%s\n", bar);
45 /* -Wformat: too few arguments for format */
46 printf("%s%s\n", "bar");
47 /* -Wformat: too many arguments for format */
48 printf("%s\n", "bar", "bar");
50 /* -Wswitch: enumeration value `b' not handled in switch */
51 switch (moe) {
52 case a:
53 return;
57 /* -Wstrict-prototypes: function declaration isn't a prototype */
58 void test3()