RS6000 buried treasure - NO_IMPLICIT_EXTERN_C
Zack Weinberg
zack@codesourcery.com
Thu Nov 7 20:50:00 GMT 2002
Of all the targets using config/rs6000, only *-linux* and *-windiss*
define NO_IMPLICIT_EXTERN_C. This just bit me good and hard while
trying to use powerpc-eabisimaltivec -- altivec.h assumes it is safe
to use C++ constructs which will spew errors under extern "C".
I am inclined to enable NO_IMPLICIT_EXTERN_C for the entire directory,
in rs6000.h. What few targets this is inappropriate for -- I'm
willing to bet that's either none, or only AIX 3.1 -- can #undef it
again.
Comments?
zw
* config/rs6000/rs6000.h: Define NO_IMPLICIT_EXTERN_C here...
* config/rs6000/linux.h, config/rs6000/linux64.h,
config/rs6000/windiss.h: ... not here.
===================================================================
Index: config/rs6000/rs6000.h
--- config/rs6000/rs6000.h 4 Nov 2002 16:57:09 -0000 1.234
+++ config/rs6000/rs6000.h 8 Nov 2002 04:49:15 -0000
@@ -24,6 +24,9 @@ Boston, MA 02111-1307, USA. */
/* Note that some other tm.h files include this one and then override
many of the definitions. */
+/* Header files should be C++ aware in general. */
+#define NO_IMPLICIT_EXTERN_C
+
/* Definitions for the object file format. These are set at
compile-time. */
===================================================================
Index: config/rs6000/linux.h
--- config/rs6000/linux.h 14 Sep 2002 13:12:53 -0000 1.33
+++ config/rs6000/linux.h 8 Nov 2002 04:49:14 -0000
@@ -21,9 +21,6 @@ along with GNU CC; see the file COPYING.
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* Don't assume anything about the header files. */
-#define NO_IMPLICIT_EXTERN_C
-
#undef MD_EXEC_PREFIX
#undef MD_STARTFILE_PREFIX
===================================================================
Index: config/rs6000/linux64.h
--- config/rs6000/linux64.h 20 Sep 2002 23:46:59 -0000 1.30
+++ config/rs6000/linux64.h 8 Nov 2002 04:49:14 -0000
@@ -106,9 +106,6 @@ Boston, MA 02111-1307, USA. */
So we have to squirrel it away with this. */
#define SETUP_FRAME_ADDRESSES() rs6000_aix_emit_builtin_unwind_init ()
-/* Don't assume anything about the header files. */
-#define NO_IMPLICIT_EXTERN_C
-
/* Override svr4.h */
#undef MD_EXEC_PREFIX
#undef MD_STARTFILE_PREFIX
===================================================================
Index: config/rs6000/windiss.h
--- config/rs6000/windiss.h 7 May 2002 14:42:29 -0000 1.1
+++ config/rs6000/windiss.h 8 Nov 2002 04:49:15 -0000
@@ -45,5 +45,3 @@ Boston, MA 02111-1307, USA. */
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 16
-
-#define NO_IMPLICIT_EXTERN_C
More information about the Gcc-patches
mailing list