This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: Complicated dg test cases


While preparing to try this, I noticed that the existing compat
patches seem to have an undefined exit status. This is bad, isn't it?
Unless I'm confused, we should add a 'return 0;' to the end of g++.dg/compat/*/*_main.C, e.g.


--- gcc-3.3.2/gcc/testsuite/g++.dg/compat/abi/bitfield1_main.C.old Mon Feb 9 03:10:11 2004
+++ gcc-3.3.2/gcc/testsuite/g++.dg/compat/abi/bitfield1_main.C Mon Feb 9 03:10:49 2004
@@ -10,4 +10,5 @@
main ()
{
bitfield1_x ();
+ return 0;
}


I haven't seen these fail because of the missing return, but maybe that's just luck.

C99, 5.1.2.2.3/1:


"... reaching the } that terminates the main function returns a value of 0."

so it's not necessary to explicitly return 0 (at least, in C99).

But yeah, it's cleaner, of course.


Segher



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