This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix open_memstream namespace (bug 18498)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Fri, 5 Jun 2015 22:56:48 +0000
- Subject: Re: Fix open_memstream namespace (bug 18498)
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1506052230060 dot 16975 at digraph dot polyomino dot org dot uk> <20150605223747 dot E39E42C39E3 at topped-with-meat dot com>
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