Fix open_memstream namespace (bug 18498)
Joseph Myers
joseph@codesourcery.com
Sat Jun 6 12:40:00 GMT 2015
On Fri, 5 Jun 2015, Roland McGrath wrote:
> > +/* The prototype needs repeating instead of using __typeof to use
> > + __THROW in C++. */
> > +extern FILE *__open_memstream (char **, size_t *) __THROW __wur;
> > +libc_hidden_proto (__open_memstream)
>
> Does "extern __typeof (open_memstream) __open_memstream __THROW __wur;" not
> work? That would be less duplication anyway. Regardless, the comment
> reads as odd in its mention of C++ since there is C++ code in libc to be
> calling this.
The C++ code is in testcases, which produce an "expected initializer
before 'throw'" error if you use the typeof construct (that is, C++ throw
() only works with an actual function declarator, not when typeof is used
to give something a function type). Hence the comment, to explain why
__typeof isn't used.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list