libintl.h not namespace clean in C++ mode
GOTO Masanori
gotom@debian.or.jp
Wed Jul 21 00:12:00 GMT 2004
At Tue, 20 Jul 2004 22:59:11 +0200,
Bruno Haible wrote:
> GOTO Masanori wrote:
> > * intl/libintl.h: Don't use optimizing gettext definition in C++ mode.
>
> It's not a particularly good idea to optimize things differently in C++ mode
> than in C mode: It causes surprises to the programmers.
I've confirmed that C++ optimization in your patch is valuable for
some cases. Using my simple program which only calls gettext about
10000000 times on P4 2.4C with g++ 3.3.4 -O3 shows:
No optimization:
7.157u 0.003s 0:07.16 99.8% 0+0k 0+0io 0pf+0w
Bruno's optimization using inline function which does not
break user defined "gettext" method:
7.132u 0.000s 0:07.13 100.0% 0+0k 0+0io 0pf+0w
> Also why does your patch test the value of __cplusplus, while all other
> glibc header files test 'defined (__cplusplus)' ?
Right, my mistake.
Ulrich, could you look at Bruno's patch?
Regards,
-- gotom
More information about the Libc-alpha
mailing list