[PATCH] C++: fix ordering of missing std #include suggestion (PR c++/81514)

Martin Sebor msebor@gmail.com
Thu Jul 27 22:51:00 GMT 2017


> I'm not sure why Solaris' decl of std::sprintf doesn't hit the
> reject path above.
>
> I was able to reproduce the behavior seen on Solaris on my Fedora
> box by using this:
>
>   namespace std
>   {
>     extern int sprintf (char *dst, const char *format, ...);
>   }

This is how C library symbols were intended to be declared
in the C++ <cxxx> headers (plus extern "C" that GCC doesn't
implement).  Very few systems went to the trouble to make
those changes.  Solaris was one of them.

Martin



More information about the Gcc-patches mailing list