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]
Other format: [Raw text]

[PATCH]:


The builtins-config.h file determines whether various testcases should
check C99 features in GCC.  The solaris10 block in there never activated
because it looks for a macro that's defined in <sys/feature_tests.h> on
solaris10 but we never include the header.

I was thinking of including <sys/feature_tests.h> guarded by #ifdef __sun,
but I wasn't sure that header existed in all solaris versions.  I later
realized that <sys/feature_tests.h> is included by many other system
headers, <sys/types.h> being among them.

Since <sys/types.h> is already included by builtins-config.h, I don't have
to add any headers I just have to move the solaris block to after where
<sys/types.h> is already included.  That seems safer to me.

Tested via "make check" on solaris10 and solaris7.  If there are no
objections, I'll install it as "obvious" on all active branches after 24
hours.

		Thanks,
		--Kaveh


2006-10-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* gcc.dg/builtins-config.h: Move Solaris section after inclusion
	of <sys/types.h>.

diff -rup orig/egcc-SVN20061008/gcc/testsuite/gcc.dg/builtins-config.h egcc-SVN20061008/gcc/testsuite/gcc.dg/builtins-config.h
--- orig/egcc-SVN20061008/gcc/testsuite/gcc.dg/builtins-config.h	2006-10-08 01:32:12.000000000 -0400
+++ egcc-SVN20061008/gcc/testsuite/gcc.dg/builtins-config.h	2006-10-10 13:51:04.452809164 -0400
@@ -11,15 +11,6 @@

 #if defined(__hppa) && defined(__hpux)
 /* PA HP-UX doesn't have the entire C99 runtime.  */
-#elif defined(__sun) && __STDC_VERSION__ - 0 < 199901L
-/* Solaris up to 9 doesn't have the entire C99 runtime.
-   Solaris 10 defines _STDC_C99 if __STDC_VERSION__ is >= 199901L.
-   But, if you're including this file, you probably want to test the
-   newer behaviour, so: */
-#error forgot to set -std=c99.
-#elif defined(__sun) && ! defined (_STDC_C99)
-/* Solaris up to 9 doesn't have the entire C99 runtime.
-   Solaris 10 defines _STDC_C99 if __STDC_VERSION__ is >= 199901L.  */
 #elif defined(__sgi)
 /* Irix6 doesn't have the entire C99 runtime.  */
 #elif defined(__FreeBSD__) && (__FreeBSD__ < 5)
@@ -49,6 +40,15 @@
    lacks the C99 functions.  */
 #include <sys/types.h>
 #if defined(_NEWLIB_VERSION) || defined(__UCLIBC__)
+#elif defined(__sun) && __STDC_VERSION__ - 0 < 199901L
+/* If you're including this file, you probably want to test the newer
+   behaviour, so ensure the right flags were used for each test: */
+#error forgot to set -std=c99.
+#elif defined(__sun) && ! defined (_STDC_C99)
+/* Solaris up to 9 doesn't have the entire C99 runtime.
+   Solaris 10 defines _STDC_C99 if __STDC_VERSION__ is >= 199901L.
+   This macro is defined in <sys/feature_tests.h> which is included by
+   various system headers, in this case <sys/types.h> above.  */
 #else
 #define HAVE_C99_RUNTIME
 #endif


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