This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR c++/PR48035
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Dodji Seketeli <dseketel at redhat dot com>
- Cc: Jason Merrill <jason at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 10 Mar 2011 19:22:57 +0100
- Subject: Re: [PATCH] PR c++/PR48035
- References: <m3r5afuf57.fsf@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Mar 10, 2011 at 05:14:12PM +0100, Dodji Seketeli wrote:
> --- /dev/null
> +++ b/gcc/testsuite/g++.dg/inherit/virtual8.C
...
> +
> +int
> +main ()
> +{
> + char *v = new char[sizeof (E) + 16];
> + memset (v, 0x55, sizeof (E) + 16);
> + E *e = new (v) E ();
> + e->~E ();
> +
> + for (unsigned i = sizeof (E); i < sizeof (E) + 16; ++i)
> + if (v[i] != 0x55)
> + return 1;
> +
> + delete[] v;
> + return 0;
> +}
The standard way of signalizing a test failure is calling abort (),
not returning 1, see http://gcc.gnu.org/codingconventions.html
(Testsuite Conventions). While exit (0); isn't widely used
for testcase success (and return 0; can be omitted at the end of
main in C++ or C99), abort as the method of signalizing failure
is the norm.
Jakub