Bug 1051 - __BEGIN_NAMESPACE_STD / __END_NAMESPACE_C99
Summary: __BEGIN_NAMESPACE_STD / __END_NAMESPACE_C99
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: unspecified
: P2 minor
Target Milestone: ---
Assignee: GOTO Masanori
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-06 05:44 UTC by Ralph Loader
Modified: 2005-09-17 17:28 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
A perl script to check pairing of __BEGIN ... __END strings. (366 bytes, application/x-perl)
2005-07-06 05:47 UTC, Ralph Loader
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Loader 2005-07-06 05:44:32 UTC
In stdlib.h one occurrence of __BEGIN_NAMESPACE_STD before strtol/strtoul is
paired with __END_NAMESPACE_C99.

I assume that the intention was for it to be paired with __END_NAMESPACE_STD
even if it makes no difference in practice.

Also, there is an apparently extraneous __END_NAMESPACE_C99 in wctype.h

Patch below.

diff -u /usr/include/stdlib.h ./stdlib.h
--- /usr/include/stdlib.h       2005-05-30 23:11:20.000000000 +1200
+++ ./stdlib.h  2005-07-06 11:47:41.000000000 +1200
@@ -188,7 +188,7 @@
 extern unsigned long int strtoul (__const char *__restrict __nptr,
                                  char **__restrict __endptr, int __base)
      __THROW __nonnull ((1)) __wur;
-__END_NAMESPACE_C99
+__END_NAMESPACE_STD
 
 #if defined __GLIBC_HAVE_LONG_LONG && defined __USE_BSD
 /* Convert a string to a quadword integer.  */
diff -u /usr/include/wctype.h ./wctype.h
--- /usr/include/wctype.h       2005-05-30 23:11:43.000000000 +1200
+++ ./wctype.h  2005-07-06 11:50:42.000000000 +1200
@@ -44,7 +44,6 @@
 #  ifdef __USE_ISOC99
 __USING_NAMESPACE_C99(wint_t)
 #  endif
-__END_NAMESPACE_C99
 # endif
 
 /* Constant expression of type `wint_t' whose value does not correspond
Comment 1 Ralph Loader 2005-07-06 05:47:39 UTC
Created attachment 545 [details]
A perl script to check pairing of __BEGIN ... __END strings.

I wrote a small perl script to check such things.  Takes a list of file names
on the command line.  Use as you wish.
Comment 2 Ulrich Drepper 2005-09-17 17:28:19 UTC
I applied the patches and added the script in a slightly changed form.  Thanks.

Next time don't forget to add a ChangeLog entry.