This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

implicit declarations of abort/exit in test suite


This patch adds explicit declarations of abort and/or exit to all the
places in the testsuite where their absence causes problems.  This is
needed for my other patch which causes gcc to warn about implicit
declarations of builtins.

I chose to include stdlib.h or write a literal prototype depending on
whether or not the test case already included some headers.

Committed.

zw

gcc/testsuite/ChangeLog:
	* c-torture/execute/bcp-1.c: Replace abort in arg of
	__builtin_constant_p with a generic external function.

	* gcc.dg/20000108-1.c, gcc.dg/980211-1.c, gcc.dg/980414-1.c,
	gcc.dg/990119-1.c, gcc.dg/990409.c, gcc.dg/990424-1.c,
	gcc.dg/991230-1.c, gcc.dg/clobbers.c, gcc.dg/lineno.c,
	gcc.dg/noreturn-1.c, gcc.dg/trigraphs.c, gcc.dg/uninit-4.c:
	Prototype abort and/or exit.

	* gcc.dg/990407-1.c, gcc.dg/strpaste.c,
	gcc.dg/special/alias-1.c, gcc.dg/special/gcsec-1.c,
	gcc.dg/special/weak-1.c, gcc.dg/special/weak-2.c,
	gcc.dg/special/wkali-1.c, gcc.dg/special/wkali-2.c: Include stdlib.h.

libio/tests/ChangeLog:
	* tfformat.c: Include stdlib.h.

===================================================================
Index: gcc/testsuite/gcc.c-torture/execute/bcp-1.c
--- gcc/testsuite/gcc.c-torture/execute/bcp-1.c	1998/12/29 11:35:06	1.4
+++ gcc/testsuite/gcc.c-torture/execute/bcp-1.c	2000/05/23 18:21:00
@@ -1,4 +1,5 @@
 int global;
+int func(void);
 
 /* These must fail.  */
 int bad0(void) { return __builtin_constant_p(global); }
@@ -8,7 +9,7 @@ inline int bad3(int x) { return __builti
 inline int bad4(const char *x) { return __builtin_constant_p(x); }
 int bad5(void) { return bad2(1); }
 inline int bad6(int x) { return __builtin_constant_p(x+1); }
-int bad7(void) { return __builtin_constant_p(abort()); }
+int bad7(void) { return __builtin_constant_p(func()); }
 int bad8(void) { char buf[10]; return __builtin_constant_p(buf); }
 int bad9(const char *x) { return __builtin_constant_p(x[123456]); }
 int bad10(void) { return __builtin_constant_p(&global); }
===================================================================
Index: gcc/testsuite/gcc.dg/20000108-1.c
--- gcc/testsuite/gcc.dg/20000108-1.c	2000/01/09 07:14:03	1.2
+++ gcc/testsuite/gcc.dg/20000108-1.c	2000/05/23 18:21:00
@@ -5,6 +5,8 @@
 /* { dg-do run } */
 /* { dg-options "-O3" } */
 
+extern void abort (void);
+
 void foo () {} /* unused, but essential to trigger the bug */
 
 int main () {
===================================================================
Index: gcc/testsuite/gcc.dg/980211-1.c
--- gcc/testsuite/gcc.dg/980211-1.c	1998/12/16 22:23:03	1.2
+++ gcc/testsuite/gcc.dg/980211-1.c	2000/05/23 18:21:00
@@ -3,6 +3,8 @@
 /* { dg-do run { target i?86-*-* } } */
 /* { dg-options -O2 } */
 
+extern void abort (void);
+
 __inline int
 __signbitl (long double __x)
 {
===================================================================
Index: gcc/testsuite/gcc.dg/980414-1.c
--- gcc/testsuite/gcc.dg/980414-1.c	1999/09/02 07:19:47	1.4
+++ gcc/testsuite/gcc.dg/980414-1.c	2000/05/23 18:21:00
@@ -3,6 +3,8 @@
 /* { dg-do run { target i?86-*-* } } */
 /* { dg-options -O2 } */
 
+extern void abort (void);
+
 static __inline  double
 mypow (double __x, double __y)
 {
===================================================================
Index: gcc/testsuite/gcc.dg/990119-1.c
--- gcc/testsuite/gcc.dg/990119-1.c	2000/01/28 20:49:17	1.3
+++ gcc/testsuite/gcc.dg/990119-1.c	2000/05/23 18:21:00
@@ -6,6 +6,8 @@
 int i = __LINE__\
 ;
 
+extern void abort (void);
+
 int main (void)  /* { dg-bogus "parse error" "semicolon eaten" } */
 {
   if (i != 6)
===================================================================
Index: gcc/testsuite/gcc.dg/990407-1.c
--- gcc/testsuite/gcc.dg/990407-1.c	1999/09/04 15:09:14	1.2
+++ gcc/testsuite/gcc.dg/990407-1.c	2000/05/23 18:21:00
@@ -4,6 +4,7 @@
 /* { dg-do run } */
 
 #include <string.h>
+#include <stdlib.h>
 
 #define STR(x) #x
 
===================================================================
Index: gcc/testsuite/gcc.dg/990409-1.c
--- gcc/testsuite/gcc.dg/990409-1.c	1999/04/10 14:20:44	1.2
+++ gcc/testsuite/gcc.dg/990409-1.c	2000/05/23 18:21:00
@@ -1,6 +1,8 @@
 /* Test that __LINE__ works when embedded in a macro. */
 /* { dg-do run } */
 
+extern void abort (void);
+
 #define XLINE __LINE__
 
 void
===================================================================
Index: gcc/testsuite/gcc.dg/990424-1.c
--- gcc/testsuite/gcc.dg/990424-1.c	1999/09/04 15:09:14	1.2
+++ gcc/testsuite/gcc.dg/990424-1.c	2000/05/23 18:21:00
@@ -6,6 +6,9 @@
 
 void __attribute__((stdcall)) foo(int a, int b, int c);
 
+extern void abort (void);
+extern void exit (int);
+
 int
 main ()
 {
===================================================================
Index: gcc/testsuite/gcc.dg/991230-1.c
--- gcc/testsuite/gcc.dg/991230-1.c	1999/12/30 12:40:53	1.1
+++ gcc/testsuite/gcc.dg/991230-1.c	2000/05/23 18:21:00
@@ -3,6 +3,9 @@
 
 /* Test that floating point greater-than tests are compiled correctly with
    -ffast-math.  */
+
+extern void abort (void);
+
 static int gt (double a, double b)
 {
   if (a > b)
===================================================================
Index: gcc/testsuite/gcc.dg/clobbers.c
--- gcc/testsuite/gcc.dg/clobbers.c	1998/12/16 22:23:18	1.2
+++ gcc/testsuite/gcc.dg/clobbers.c	2000/05/23 18:21:01
@@ -2,6 +2,8 @@
 
 /* { dg-do run { target i?86-*-* } } */
 
+extern void abort (void);
+
 int main ()
 {
         int i;
===================================================================
Index: gcc/testsuite/gcc.dg/lineno-2.c
--- gcc/testsuite/gcc.dg/lineno-2.c	2000/02/06 08:24:22	1.1
+++ gcc/testsuite/gcc.dg/lineno-2.c	2000/05/23 18:21:01
@@ -2,6 +2,8 @@
 
 /* Test #line with and without macros for the line number.  */
 
+extern void abort (void);
+
 #define L 90
 
 #line 44
===================================================================
Index: gcc/testsuite/gcc.dg/noreturn-1.c
--- gcc/testsuite/gcc.dg/noreturn-1.c	2000/03/21 19:08:19	1.4
+++ gcc/testsuite/gcc.dg/noreturn-1.c	2000/05/23 18:21:01
@@ -2,6 +2,8 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -Wmissing-noreturn" } */
 
+extern void exit (int);
+
 extern void foo1(void) __attribute__ ((__noreturn__));
 void
 foo1(void)
===================================================================
Index: gcc/testsuite/gcc.dg/strpaste.c
--- gcc/testsuite/gcc.dg/strpaste.c	2000/02/06 08:24:22	1.1
+++ gcc/testsuite/gcc.dg/strpaste.c	2000/05/23 18:21:01
@@ -4,6 +4,7 @@
    We got internal escape markers in the strings.  */
 
 #include <string.h>
+#include <stdlib.h>
 
 #define S(x) _S(x)
 #define _S(x) #x
===================================================================
Index: gcc/testsuite/gcc.dg/trigraphs.c
--- gcc/testsuite/gcc.dg/trigraphs.c	2000/02/06 08:24:22	1.1
+++ gcc/testsuite/gcc.dg/trigraphs.c	2000/05/23 18:21:01
@@ -1,6 +1,8 @@
 /* { dg-do run } */
 /* { dg-options "-ansi" } */
 
+extern void abort (void);
+
 /* Basic tests for trigraph conversion.
    All of them are here, but not in all possible contexts.  *??/
 /
===================================================================
Index: gcc/testsuite/gcc.dg/uninit-4.c
--- gcc/testsuite/gcc.dg/uninit-4.c	1999/09/04 15:09:14	1.2
+++ gcc/testsuite/gcc.dg/uninit-4.c	2000/05/23 18:21:01
@@ -8,6 +8,8 @@
 /* { dg-do compile } */
 /* { dg-options "-O -Wuninitialized" } */
 
+extern void abort (void);
+
 struct operation {
     short op;
     char rprio;
===================================================================
Index: gcc/testsuite/gcc.dg/special/alias-1.c
--- gcc/testsuite/gcc.dg/special/alias-1.c	1999/09/04 15:09:15	1.2
+++ gcc/testsuite/gcc.dg/special/alias-1.c	2000/05/23 18:21:01
@@ -1,5 +1,7 @@
 /* { dg-do link } */
 
+#include <stdlib.h>
+
 extern int foo(void) __attribute__((alias("bar")));
 
 int bar(void) {
===================================================================
Index: gcc/testsuite/gcc.dg/special/gcsec-1.c
--- gcc/testsuite/gcc.dg/special/gcsec-1.c	1999/09/04 15:09:15	1.2
+++ gcc/testsuite/gcc.dg/special/gcsec-1.c	2000/05/23 18:21:01
@@ -1,5 +1,7 @@
 /* { dg-do run } */
 
+#include <stdlib.h>
+
 static int unusedint=5;
 
 static int usedint=1;
===================================================================
Index: gcc/testsuite/gcc.dg/special/weak-1.c
--- gcc/testsuite/gcc.dg/special/weak-1.c	1999/09/04 15:09:15	1.2
+++ gcc/testsuite/gcc.dg/special/weak-1.c	2000/05/23 18:21:01
@@ -1,5 +1,7 @@
 /* { dg-do run } */
 
+#include <stdlib.h>
+
 int foo(void) __attribute__((weak));
 
 int foo(void) {
===================================================================
Index: gcc/testsuite/gcc.dg/special/weak-2.c
--- gcc/testsuite/gcc.dg/special/weak-2.c	1999/09/04 15:09:15	1.2
+++ gcc/testsuite/gcc.dg/special/weak-2.c	2000/05/23 18:21:01
@@ -1,5 +1,7 @@
 /* { dg-do run } */
 
+#include <stdlib.h>
+
 extern int foo(void);
 
 int main(void) {
===================================================================
Index: gcc/testsuite/gcc.dg/special/wkali-1.c
--- gcc/testsuite/gcc.dg/special/wkali-1.c	1999/09/04 15:09:15	1.2
+++ gcc/testsuite/gcc.dg/special/wkali-1.c	2000/05/23 18:21:01
@@ -1,5 +1,7 @@
 /* { dg-do link } */
 
+#include <stdlib.h>
+
 extern int foo(void) __attribute__((weak, alias("bar")));
 
 int bar(void) {
===================================================================
Index: gcc/testsuite/gcc.dg/special/wkali-2.c
--- gcc/testsuite/gcc.dg/special/wkali-2.c	1999/09/04 15:09:15	1.2
+++ gcc/testsuite/gcc.dg/special/wkali-2.c	2000/05/23 18:21:01
@@ -1,5 +1,7 @@
 /* { dg-do run } */
 
+#include <stdlib.h>
+
 extern int foo(void);
 
 int main(void) {
===================================================================
Index: libio/tests/tfformat.c
--- libio/tests/tfformat.c	1999/09/04 15:08:51	1.2
+++ libio/tests/tfformat.c	2000/05/23 18:21:04
@@ -8,6 +8,8 @@
 #endif
 #endif /* !TEST_LIBIO */
 
+#include <stdlib.h>	/* for exit */
+
 /* Tests taken from Cygnus C library. */
 
 typedef struct

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]