This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: PATCH to libstdc++: Don't be sloppy about names used in templates
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: gcc at integrable-solutions dot net, gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: 14 Jul 2003 16:16:17 +0200
- Subject: Re: PATCH to libstdc++: Don't be sloppy about names used in templates
- Organization: Integrable Solutions
- References: <m23ch9i624.fsf@dromion.integrable-solutions.net><je65m5fb7w.fsf@sykes.suse.de>
Andreas Schwab <schwab@suse.de> writes:
| gcc@integrable-solutions.net writes:
|
| |> --- 89,104 ----
| |> __ret = snprintf(__out, __size, __fmt, __v);
| |> #else
| |> if (__prec >= 0)
| |> ! __ret = std::sprintf(__out, __fmt, __prec, __v);
| |> else
| |> ! __ret = std::sprintf(__out, __fmt, __v);
| |> #endif
| |>
| |> #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
| |> __gnu_cxx::__uselocale(__old);
| |> #else
| |> ! std::setlocale(LC_ALL, __sav);
| |> ! std::free(__sav);
| |> #endif
| |> return __ret;
| |> }
| |>
|
| What about snprintf (ifdef GLIBCXX_USE_C99)? Will it need a std:: prefix
| as well?
Good question. Firstly I was surprised to it there at all.
Secondly, snprintf is not declared in std:: -- which is no good
because it means that a we're counting on a non-<xxx.h> file to put
something in the global space, which is clearly wrong.
In the end, I decided to apply the small fix and raise the bigger
issue latter.
Now that you ask the question, I'm attempted to reply: What snprintf
is doing there without being properly scoped? Sorry, I don't know the
answer. :-(
-- Gaby