[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Serious problem with default headers and C++.
From: |
Akim Demaille |
Subject: |
Re: Serious problem with default headers and C++. |
Date: |
Thu, 22 May 2003 09:14:45 +0200 |
User-agent: |
Gnus/5.1001 (Gnus v5.10.1) Emacs/21.3 (gnu/linux) |
Please, keep public matters public.
| On Wed, 21 May 2003, Akim Demaille wrote:
| > |
| > | I will try to see myself what I can do with
| > |
| > | cc-1035 CC: WARNING File = /usr/include/CC/cstdio, Line = 4
| > | #error directive: This header requires the -LANG:libc_in_namespace_std
| > | option
| > |
| > | #error This header requires the -LANG:libc_in_namespace_std option
| > | ^
| > |
| > | But actually the compiler does not recognise the
| > | -LANG:libc_in_namespace_std option !
| >
|
| You'll find the test at the end....
|
| > Wow :( This is a serious problem. I should have thought about this
| > issue before: the default headers should depend upon the current
| > language...
| >
| >
| > | configure:3331: CC -c -64 -mips4 -O3 -LANG:std -LANG:restrict
-no_auto_include -I/home/u4/patrickg/include -I/home/u4/patrickg/include
conftest.cc >&5
| > | cc-1035 CC: WARNING File = /usr/include/CC/cstdio, Line = 4
| > | #error directive: This header requires the -LANG:libc_in_namespace_std
option
| > |
| > | #error This header requires the -LANG:libc_in_namespace_std option
| > | ^
| > |
| > | cc-1229 CC: ERROR File = /usr/include/internal/stdio_core.h, Line = 220
| > | The redeclaration of type name "__file_s" (declared at line 183 of
| > | "/opt/MIPSpro/7.3.1.3/usr/include/stdio.h") is invalid.
| > |
| > | __file_s
| > | ^
| > |
| >
| >
| > May I ask you to try to compile the following programs? Thanks a lot!
| > (PS/ What package were you compiling?).
| >
|
| My simulation code
|
| >
| > 1.
| > #include <cstdio>
| >
|
| % CC test1.cc -c -LANG:std -LANG:restrict
| cc-1035 CC: WARNING File = /usr/include/CC/cstdio, Line = 4
| #error directive: This header requires the -LANG:libc_in_namespace_std
| option
|
| #error This header requires the -LANG:libc_in_namespace_std option
| ^
| % echo $status
| 0
A warning. OK.
| I will have to send a message to SGI about this macro since
| % CC test1.cc -c -LANG:std -LANG:restrict -LANG:libc_in_namespace_std
| option
| Warning: Option 'libc_in_namespace_std' not in group 'LANG'
| (LANG:libc_in_namespace_std)
| cc-1035 CC: WARNING File = /usr/include/CC/cstdio, Line = 4
| #error directive: This header requires the -LANG:libc_in_namespace_std
| option
|
| #error This header requires the -LANG:libc_in_namespace_std option
| ^
|
| Warning: Option 'libc_in_namespace_std' not in group 'LANG'
| (LANG:libc_in_namespace_std)
|
| There is no such option...
OK.
| > 2.
| > #include <stdio.h>
| >
|
| % CC test2.cc -c -LANG:std -LANG:restrict
| % echo $status
| 0
|
| No trouble
|
| >
| > 3.
| > #include <stdio.h>
| > #include <cstdio>
| >
|
| % CC test3.cc -c -LANG:std -LANG:restrict
| ....
| cc-3452 CC: ERROR File = /usr/include/internal/stdio_core.h, Line = 440
| The compilation is aborted due to the number of errors.
|
|
| 101 errors detected in the compilation of "test3.cc".
| % echo $status
| 2
|
|
| Now I see the trouble, when I was just check for cstdio
| AC_CHECK_HEADER([cstdio], AC_DEFINE(HAVE_CSTDIO))
| autoconf actually add #include <stdio.h> before ?
Because it meant to help you, but failed miserably. It is time to
further separate C and C++ in Autoconf.
| I do the same for actually all the include <c....> from <.....h>
Try to add [ ] (with a space, or maybe a simple comment) as fourth arg
(default includes).
This is something we must address asap.