This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH to libstdc++: Don't be sloppy about names used in templates


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]