Re: -LANG:libc_in_namespace_std=ON problems
The following header lines retained to effect attribution:[color=blue]
>X-Trace:
>Date: Thu, 04 Mar 2004 20:23:16 -0600
>From: Albert Chin-A-Young <china@foo.com>
>Subject: -LANG:libc_in_namespace_std=ON problems
>To: [email]info-iris-admin@ARL.ARMY.MIL[/email]
> hepa2.fnal.gov
> version=2.61[/color]
[color=blue]
>In 7.4.1, -LANG:libc_in_namespace_std=ON is the default. That's ok.
>However, it doesn't seem that all of /usr/include is prepared for this:
> $ uname -R
> 6.5 6.5.19m
> $ CC -v
> MIPSpro Compilers: Version 7.41
> $ cat a.cc
> #include <sys/time.h>
> $ CC -c a.cc
> cc-1132 CC: ERROR File = /usr/include/sys/types.h, Line = 532
> The namespace "std" has no member "time_t".[/color]
[color=blue]
> __SGI_LIBC_USING_FROM_STD(time_t)
> ^[/color]
[color=blue]
> cc-1132 CC: ERROR File = /usr/include/sys/types.h, Line = 533
> The namespace "std" has no member "clock_t".[/color]
[color=blue]
> __SGI_LIBC_USING_FROM_STD(clock_t)
> ^
> ..[/color]
[color=blue]
>Should /usr/include/sys/time.h include <time.h>?[/color]
[color=blue]
>albert chin[/color]
No.
time.h includes sys/timespec.h. Please, examine the comments there.
Randolph J. Herber, [email]herber@fnal.gov[/email], +1 630 840 2966, CD/CDFTF PK-149F,
Mail Stop 318, Fermilab, Kirk & Pine Rds., PO Box 500, Batavia, IL 60510-0500,
USA. (Speaking for myself and not for US, US DOE, FNAL nor URA.) (Product,
trade, or service marks herein belong to their respective owners.)
Re: -LANG:libc_in_namespace_std=ON problems
Randolph J. Herber <herber@dcdrjh.fnal.gov> wrote:[color=blue]
> The following header lines retained to effect attribution:[color=green]
>>X-Trace:
>>Date: Thu, 04 Mar 2004 20:23:16 -0600
>>From: Albert Chin-A-Young <china@foo.com>
>>Subject: -LANG:libc_in_namespace_std=ON problems
>>To: [email]info-iris-admin@ARL.ARMY.MIL[/email]
>> hepa2.fnal.gov
>> version=2.61[/color]
>[color=green]
>>In 7.4.1, -LANG:libc_in_namespace_std=ON is the default. That's ok.
>>However, it doesn't seem that all of /usr/include is prepared for this:
>> $ uname -R
>> 6.5 6.5.19m
>> $ CC -v
>> MIPSpro Compilers: Version 7.41
>> $ cat a.cc
>> #include <sys/time.h>
>> $ CC -c a.cc
>> cc-1132 CC: ERROR File = /usr/include/sys/types.h, Line = 532
>> The namespace "std" has no member "time_t".[/color]
>[color=green]
>> __SGI_LIBC_USING_FROM_STD(time_t)
>> ^[/color]
>[color=green]
>> cc-1132 CC: ERROR File = /usr/include/sys/types.h, Line = 533
>> The namespace "std" has no member "clock_t".[/color]
>[color=green]
>> __SGI_LIBC_USING_FROM_STD(clock_t)
>> ^
>> ..[/color]
>[color=green]
>>Should /usr/include/sys/time.h include <time.h>?[/color]
>[color=green]
>>albert chin[/color]
>
> No.
>
> time.h includes sys/timespec.h. Please, examine the comments there.[/color]
Looks like 6.5.22 fixes this. The diff below fixes it on 6.5.19 for me
(this is the 6.5.22 <sys/time.h> file). Thanks to Frank Campana at SGI
for the fix.
--
albert chin
-- snip snip
--- sys/time.h.orig Fri Feb 14 12:34:31 2003
+++ sys/time.h Fri Mar 5 23:42:56 2004
@@ -24,18 +24,21 @@
#ifndef _SYS_TIME_H
#define _SYS_TIME_H
-#ident "$Revision: 3.58 $"
+#ident "$Revision: 3.59 $"
#ifdef __cplusplus
extern "C" {
#endif
#include <standards.h>
#include <sgidefs.h>
+#include <internal/sgimacros.h>
/*
* NOTE: this is a POSIX/XPG header - watch for name space pollution
*/
+__SGI_LIBC_BEGIN_NAMESPACE_STD
+
#ifndef _CLOCK_T
#define _CLOCK_T
#if _MIPS_SZLONG == 32
@@ -56,6 +59,10 @@
typedef int time_t; /* <time> type */
#endif
#endif /* !_TIME_T */
+
+__SGI_LIBC_END_NAMESPACE_STD
+__SGI_LIBC_USING_FROM_STD(time_t)
+__SGI_LIBC_USING_FROM_STD(clock_t)
/* this also defined in dmcommon.h */
/* stamp_t: SGI-specific type for USTs and MSCs */