This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: Fix open_memstream namespace (bug 18498)


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


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