This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Implicit declaration fixes, C++ test suite
- To: gcc-patches at gcc dot gnu dot org
- Subject: Implicit declaration fixes, C++ test suite
- From: Zack Weinberg <zack at wolery dot cumb dot org>
- Date: Sat, 27 May 2000 22:37:38 -0700
Pretty boring.
I took the opportunity to fix g++.other/goto1.C which needed its magic
comments updated to match recent changes to error reporting.
Committed.
zw
Relative to g++.dg/special:
* conpr-1.C, conpr-2.C, conpr-3.C: Include stdlib.h.
Relative to g++.old-deja:
* g++.brendan/complex1.C, g++.jason/optimize2.C,
g++.mike/p9732b.C, g++.other/addrof1.C, g++.other/dyncast5.C,
g++.other/init5.C, g++.other/init7.C, g++.other/union2.C,
g++.pt/vbase1.C, g++.robertl/eb14.C, g++.robertl/eh990323-1.C,
g++.robertl/eh990323-2.C, g++.robertl/eh990323-3.C,
g++.robertl/eh990323-4.C, g++.robertl/eh990323-5.C,
g++.robertl/ice990323-2.C: Prototype exit and/or abort.
* g++.brendan/nest21.C, g++.eh/rethrow3.C, g++.jason/init3.C,
g++.law/arm15.C, g++.law/cvt2.C, g++.law/visibility17.C,
g++.mike/eh23.C, g++.mike/eh25.C, g++.mike/eh34.C,
g++.mike/eh48.C, g++.mike/eh55.C, g++.mike/p2736.C,
g++.oliva/new1.C, g++.other/align.C, g++.robertl/eb39.C,
g++.robertl/eb54.C, g++.robertl/eb63.C: Include stdlib.h
and/or string.h.
* g++.other/goto1.C: Update expectations for error messages.
===================================================================
Index: testsuite/g++.dg/special/conpr-1.C
--- testsuite/g++.dg/special/conpr-1.C 1999/09/04 15:09:01 1.2
+++ testsuite/g++.dg/special/conpr-1.C 2000/05/28 05:22:58
@@ -1,5 +1,7 @@
/* { dg-do run } */
+#include <stdlib.h>
+
class foo_t {
int x;
public:
===================================================================
Index: testsuite/g++.dg/special/conpr-2.C
--- testsuite/g++.dg/special/conpr-2.C 1999/09/04 15:09:01 1.2
+++ testsuite/g++.dg/special/conpr-2.C 2000/05/28 05:22:58
@@ -1,5 +1,7 @@
/* { dg-do run } */
+#include <stdlib.h>
+
class foo_t {
int x;
static int count;
===================================================================
Index: testsuite/g++.dg/special/conpr-3.C
--- testsuite/g++.dg/special/conpr-3.C 1999/09/04 15:09:01 1.2
+++ testsuite/g++.dg/special/conpr-3.C 2000/05/28 05:22:58
@@ -1,5 +1,7 @@
/* { dg-do run } */
+#include <stdlib.h>
+
class foo_t {
int x;
static int count;
===================================================================
Index: testsuite/g++.old-deja/g++.brendan/complex1.C
--- testsuite/g++.old-deja/g++.brendan/complex1.C 2000/01/04 15:52:22 1.3
+++ testsuite/g++.old-deja/g++.brendan/complex1.C 2000/05/28 05:22:58
@@ -5,7 +5,10 @@
// a bug where the compiler was not converting the integer `90' to a
// complex number, unless you did `90.0'. Fixed 10/1/1997.
-extern "C" int printf (const char *, ...);
+extern "C" {
+int printf (const char *, ...);
+void exit (int);
+};
__complex__ double cd;
===================================================================
Index: testsuite/g++.old-deja/g++.brendan/nest21.C
--- testsuite/g++.old-deja/g++.brendan/nest21.C 1998/12/16 21:26:07 1.3
+++ testsuite/g++.old-deja/g++.brendan/nest21.C 2000/05/28 05:22:58
@@ -1,6 +1,7 @@
// GROUPS passed nested-classes
#include <iostream.h>
#include <stdio.h>
+#include <string.h>
static char output[1024];
===================================================================
Index: testsuite/g++.old-deja/g++.eh/rethrow3.C
--- testsuite/g++.old-deja/g++.eh/rethrow3.C 1998/12/16 21:30:08 1.4
+++ testsuite/g++.old-deja/g++.eh/rethrow3.C 2000/05/28 05:22:58
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <stdlib.h>
#include <exception>
static void
===================================================================
Index: testsuite/g++.old-deja/g++.jason/init3.C
--- testsuite/g++.old-deja/g++.jason/init3.C 1998/12/16 21:33:33 1.3
+++ testsuite/g++.old-deja/g++.jason/init3.C 2000/05/28 05:22:58
@@ -1,8 +1,7 @@
// PRMS Id: 5652
// Bug: strings does not get initialized.
-extern "C" void * memcpy (void *, const void *, __SIZE_TYPE__);
-extern "C" int strcmp (const char *, const char *);
+#include <string.h>
class My_string {
char *str;
===================================================================
Index: testsuite/g++.old-deja/g++.jason/optimize2.C
--- testsuite/g++.old-deja/g++.jason/optimize2.C 1998/12/16 21:34:34 1.2
+++ testsuite/g++.old-deja/g++.jason/optimize2.C 2000/05/28 05:22:58
@@ -1,6 +1,8 @@
// Used to crash on the alpha with optimization.
// Special g++ Options: -w
+extern "C" void abort (void);
+
struct Fix {
unsigned short l;
};
===================================================================
Index: testsuite/g++.old-deja/g++.law/arm15.C
--- testsuite/g++.old-deja/g++.law/arm15.C 1998/12/16 21:39:01 1.2
+++ testsuite/g++.old-deja/g++.law/arm15.C 2000/05/28 05:22:58
@@ -6,6 +6,7 @@
// Message-ID: <9310211510.AA14943@holden.lulea.trab.se>
#include <stdio.h>
+#include <stdlib.h>
int state = 0;
===================================================================
Index: testsuite/g++.old-deja/g++.law/cvt2.C
--- testsuite/g++.old-deja/g++.law/cvt2.C 1998/12/16 21:40:07 1.3
+++ testsuite/g++.old-deja/g++.law/cvt2.C 2000/05/28 05:22:58
@@ -1,12 +1,9 @@
// GROUPS passed conversions
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <iostream.h>
#include <fstream.h>
-
-extern "C" {
-int strncmp (const char *, const char *, size_t);
-}
class cvec {
public:
===================================================================
Index: testsuite/g++.old-deja/g++.law/visibility17.C
--- testsuite/g++.old-deja/g++.law/visibility17.C 1998/12/16 21:42:55 1.3
+++ testsuite/g++.old-deja/g++.law/visibility17.C 2000/05/28 05:22:58
@@ -6,6 +6,7 @@
// Subject: Access to private constructor.
// Message-ID: <9308060023.AA10283@neptune.caere.com>
#include <iostream.h>
+#include <string.h>
class Base
{
===================================================================
Index: testsuite/g++.old-deja/g++.mike/eh23.C
--- testsuite/g++.old-deja/g++.mike/eh23.C 1998/12/16 21:43:59 1.3
+++ testsuite/g++.old-deja/g++.mike/eh23.C 2000/05/28 05:22:58
@@ -2,6 +2,7 @@
// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-*
#include <exception>
+#include <stdlib.h>
struct double_fault { };
int fault_now;
===================================================================
Index: testsuite/g++.old-deja/g++.mike/eh25.C
--- testsuite/g++.old-deja/g++.mike/eh25.C 1998/12/16 21:44:01 1.3
+++ testsuite/g++.old-deja/g++.mike/eh25.C 2000/05/28 05:22:58
@@ -2,6 +2,7 @@
// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-*
#include <exception>
+#include <stdlib.h>
void my_terminate() {
exit (0); // Double faults should call terminate
===================================================================
Index: testsuite/g++.old-deja/g++.mike/eh34.C
--- testsuite/g++.old-deja/g++.mike/eh34.C 1998/12/16 21:44:12 1.5
+++ testsuite/g++.old-deja/g++.mike/eh34.C 2000/05/28 05:22:58
@@ -2,6 +2,7 @@
// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-*
#include <exception>
+#include <stdlib.h>
void my_unexpected() {
exit (0);
===================================================================
Index: testsuite/g++.old-deja/g++.mike/eh48.C
--- testsuite/g++.old-deja/g++.mike/eh48.C 1998/12/16 21:44:28 1.3
+++ testsuite/g++.old-deja/g++.mike/eh48.C 2000/05/28 05:22:58
@@ -2,6 +2,8 @@
// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-*
#include <exception>
+#include <stdlib.h>
+
using std::uncaught_exception;
class A {
public:
===================================================================
Index: testsuite/g++.old-deja/g++.mike/eh55.C
--- testsuite/g++.old-deja/g++.mike/eh55.C 1998/12/16 21:44:36 1.4
+++ testsuite/g++.old-deja/g++.mike/eh55.C 2000/05/28 05:22:58
@@ -2,6 +2,7 @@
// excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-*
#include <exception>
+#include <stdlib.h>
void my_terminate_handler() {
exit(0);
===================================================================
Index: testsuite/g++.old-deja/g++.mike/p2736.C
--- testsuite/g++.old-deja/g++.mike/p2736.C 1998/12/16 21:46:52 1.3
+++ testsuite/g++.old-deja/g++.mike/p2736.C 2000/05/28 05:22:58
@@ -2,6 +2,8 @@
// statics are destroyed at the right time. See PR 2736 for details.
// prms-id: 2736
+#include <stdlib.h>
+
int count;
struct A {
===================================================================
Index: testsuite/g++.old-deja/g++.mike/p9732b.C
--- testsuite/g++.old-deja/g++.mike/p9732b.C 1998/12/16 21:48:53 1.4
+++ testsuite/g++.old-deja/g++.mike/p9732b.C 2000/05/28 05:22:58
@@ -3,7 +3,9 @@
int count;
int bail = 0;
+extern "C" void abort (void);
extern "C" void _exit (int);
+
struct base {
base () { ++count; }
===================================================================
Index: testsuite/g++.old-deja/g++.oliva/new1.C
--- testsuite/g++.old-deja/g++.oliva/new1.C 1999/08/05 21:32:21 1.2
+++ testsuite/g++.old-deja/g++.oliva/new1.C 2000/05/28 05:22:58
@@ -7,6 +7,7 @@
// execution test
#include <new>
+#include <stdlib.h>
struct A {
A() { throw 0; }
===================================================================
Index: testsuite/g++.old-deja/g++.other/addrof1.C
--- testsuite/g++.old-deja/g++.other/addrof1.C 1998/12/16 21:51:30 1.2
+++ testsuite/g++.old-deja/g++.other/addrof1.C 2000/05/28 05:22:58
@@ -1,3 +1,6 @@
+
+extern "C" void abort ();
+
typedef struct st {
unsigned char a;
unsigned char b;
===================================================================
Index: testsuite/g++.old-deja/g++.other/align.C
--- testsuite/g++.old-deja/g++.other/align.C 2000/05/02 15:17:07 1.1
+++ testsuite/g++.old-deja/g++.other/align.C 2000/05/28 05:22:58
@@ -1,4 +1,5 @@
// Build don't link:
+#include <string.h>
class bar {
public:
===================================================================
Index: testsuite/g++.old-deja/g++.other/dyncast5.C
--- testsuite/g++.old-deja/g++.other/dyncast5.C 1999/09/21 15:00:38 1.1
+++ testsuite/g++.old-deja/g++.other/dyncast5.C 2000/05/28 05:22:58
@@ -3,6 +3,8 @@
// dynamic cast can only cast to public unambiguous bases
+extern "C" void abort ();
+
struct A {virtual ~A(){} int m; };
struct B {virtual ~B(){} int m; };
===================================================================
Index: testsuite/g++.old-deja/g++.other/goto1.C
--- testsuite/g++.old-deja/g++.other/goto1.C 1999/10/21 08:05:56 1.1
+++ testsuite/g++.old-deja/g++.other/goto1.C 2000/05/28 05:22:58
@@ -10,12 +10,12 @@ struct S
void f ()
{
{
- S s1;
+ S s1; // ERROR - skips initialization
- t:
+ t: // ERROR - jump to label
S s2;
;
}
- goto t; // ERROR - jump avoids initialization of `s1'
+ goto t; // ERROR - from here
}
===================================================================
Index: testsuite/g++.old-deja/g++.other/init5.C
--- testsuite/g++.old-deja/g++.other/init5.C 1998/12/16 21:52:36 1.2
+++ testsuite/g++.old-deja/g++.other/init5.C 2000/05/28 05:22:58
@@ -2,6 +2,8 @@
// Original test attributed to James Kanze <jkanze@otelo.ibmmail.com>
// execution test - XFAIL *-*-*
+extern "C" void abort ();
+
static int cnt;
class A {
===================================================================
Index: testsuite/g++.old-deja/g++.other/init7.C
--- testsuite/g++.old-deja/g++.other/init7.C 1998/12/16 21:52:38 1.3
+++ testsuite/g++.old-deja/g++.other/init7.C 2000/05/28 05:22:58
@@ -4,6 +4,8 @@
// The initialization of a static local variable must be retried if a
// previous try finished by throwing an exception [stmt.dcl]/4
+extern "C" void abort ();
+
struct foo {
foo() { throw true; }
};
===================================================================
Index: testsuite/g++.old-deja/g++.other/union2.C
--- testsuite/g++.old-deja/g++.other/union2.C 1999/10/14 02:18:10 1.1
+++ testsuite/g++.old-deja/g++.other/union2.C 2000/05/28 05:22:58
@@ -2,6 +2,8 @@
// Bug: gcc and g++ didn't zero unions with empty initializers.
// Submitted by J"orn Rennecke <amylaar@cygnus.co.uk>
+extern "C" void exit (int);
+
typedef union u
{
union u *up;
===================================================================
Index: testsuite/g++.old-deja/g++.pt/vbase1.C
--- testsuite/g++.old-deja/g++.pt/vbase1.C 1998/12/16 22:02:40 1.2
+++ testsuite/g++.old-deja/g++.pt/vbase1.C 2000/05/28 05:22:58
@@ -1,6 +1,8 @@
// Check that template classes handle inherited virtual bases
// properly, initializing them before direct non-virtual bases.
+extern "C" void exit (int);
+
int aflag;
struct A
===================================================================
Index: testsuite/g++.old-deja/g++.robertl/eb14.C
--- testsuite/g++.old-deja/g++.robertl/eb14.C 1998/12/16 22:03:28 1.2
+++ testsuite/g++.old-deja/g++.robertl/eb14.C 2000/05/28 05:22:58
@@ -1,3 +1,6 @@
+
+extern "C" void abort ();
+
template<int N>
struct I {
};
===================================================================
Index: testsuite/g++.old-deja/g++.robertl/eb39.C
--- testsuite/g++.old-deja/g++.robertl/eb39.C 1998/12/16 22:03:57 1.2
+++ testsuite/g++.old-deja/g++.robertl/eb39.C 2000/05/28 05:22:58
@@ -4,6 +4,7 @@
// #include <streambuf.h>
#include <libio.h>
#include <strstream.h>
+#include <string.h>
extern bool foo2 (ostream &out, istream &in);
===================================================================
Index: testsuite/g++.old-deja/g++.robertl/eb44.C
--- testsuite/g++.old-deja/g++.robertl/eb44.C 1998/12/16 22:04:01 1.4
+++ testsuite/g++.old-deja/g++.robertl/eb44.C 2000/05/28 05:22:58
@@ -5,6 +5,7 @@
// friend function, the non-template function does
#include <stdio.h>
+#include <stdlib.h>
#include <iostream.h>
template <class T>
===================================================================
Index: testsuite/g++.old-deja/g++.robertl/eb54.C
--- testsuite/g++.old-deja/g++.robertl/eb54.C 1998/12/16 22:04:11 1.2
+++ testsuite/g++.old-deja/g++.robertl/eb54.C 2000/05/28 05:22:58
@@ -1,4 +1,5 @@
#include <iomanip.h>
+#include <stdlib.h>
int main()
{
===================================================================
Index: testsuite/g++.old-deja/g++.robertl/eb63.C
--- testsuite/g++.old-deja/g++.robertl/eb63.C 1998/12/16 22:04:22 1.3
+++ testsuite/g++.old-deja/g++.robertl/eb63.C 2000/05/28 05:22:58
@@ -1,6 +1,7 @@
//Special g++ Options:
//This uses GNU extensions, so disable -ansi
#include <stdio.h>
+#include <stdlib.h>
class A {
public:
===================================================================
Index: testsuite/g++.old-deja/g++.robertl/eh990323-1.C
--- testsuite/g++.old-deja/g++.robertl/eh990323-1.C 1999/06/04 01:31:37 1.2
+++ testsuite/g++.old-deja/g++.robertl/eh990323-1.C 2000/05/28 05:22:59
@@ -1,4 +1,6 @@
// check cleanup of template temporaries
+extern "C" void abort ();
+extern "C" void exit (int);
int ctor = 0;
int dtor = 0;
===================================================================
Index: testsuite/g++.old-deja/g++.robertl/eh990323-2.C
--- testsuite/g++.old-deja/g++.robertl/eh990323-2.C 1999/09/04 15:09:09 1.2
+++ testsuite/g++.old-deja/g++.robertl/eh990323-2.C 2000/05/28 05:22:59
@@ -1,4 +1,6 @@
// check MI and VBC offsets on throw
+extern "C" void abort ();
+extern "C" void exit (int);
struct A {
int x[23];
===================================================================
Index: testsuite/g++.old-deja/g++.robertl/eh990323-3.C
--- testsuite/g++.old-deja/g++.robertl/eh990323-3.C 1999/09/04 15:09:09 1.2
+++ testsuite/g++.old-deja/g++.robertl/eh990323-3.C 2000/05/28 05:22:59
@@ -1,4 +1,6 @@
// try throwing 0 cast to a class object
+extern "C" void abort ();
+extern "C" void exit (int);
struct A {};
===================================================================
Index: testsuite/g++.old-deja/g++.robertl/eh990323-4.C
--- testsuite/g++.old-deja/g++.robertl/eh990323-4.C 1999/09/04 15:09:10 1.2
+++ testsuite/g++.old-deja/g++.robertl/eh990323-4.C 2000/05/28 05:22:59
@@ -1,4 +1,6 @@
// check MI and VBC offsets on throw
+extern "C" void abort ();
+extern "C" void exit (int);
struct A {
int x[23];
===================================================================
Index: testsuite/g++.old-deja/g++.robertl/eh990323-5.C
--- testsuite/g++.old-deja/g++.robertl/eh990323-5.C 1999/09/04 15:09:10 1.2
+++ testsuite/g++.old-deja/g++.robertl/eh990323-5.C 2000/05/28 05:22:59
@@ -1,4 +1,6 @@
// check cleanup of partial array objects
+extern "C" void abort (void);
+extern "C" void exit (int);
int ctor = 0;
int dtor = 0;
===================================================================
Index: testsuite/g++.old-deja/g++.robertl/ice990323-2.C
--- testsuite/g++.old-deja/g++.robertl/ice990323-2.C 1999/06/04 01:31:39 1.2
+++ testsuite/g++.old-deja/g++.robertl/ice990323-2.C 2000/05/28 05:22:59
@@ -1,4 +1,6 @@
// check EH with templates
+extern "C" void abort ();
+extern "C" void exit (int);
template <class T, int n, class U> struct A {
A() {}