This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Add wcharP.h to hide internal wchar functions [BZ #18822]
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 11 Dec 2017 23:40:49 +0000
- Subject: Re: [PATCH] Add wcharP.h to hide internal wchar functions [BZ #18822]
- Authentication-results: sourceware.org; auth=none
- References: <20171125001327.GA17465@gmail.com> <3fd3cd8b-03cd-154c-1cfd-bbea0b1db0bf@redhat.com>
On Mon, 11 Dec 2017, Florian Weimer wrote:
> We should enhance the toolchain to do this kind of optimization automatically
> (maybe using LTO?). Or find another way to implement the markup in a more
glibc makes use of being written as "C with ABI boundaries" - that is,
code does things that are undefined in C for the program as a whole, but
defined on the basis that each separate translation unit must implement
the semantics of the functions therein in a way that would be valid for
any valid caller. I think supporting LTO for glibc would be hard.
> It's also not clear why you need to replicate ___atribute_pure__ in those
> declarations.
Generally, an internal header can avoid repeating a function prototype
using typeof, but typeof does not copy attributes, so making an internal
declaration share the attributes of a public declaration requires
duplicating them in both places. (GCC bug 81824 requests warnings for
missing attributes on aliases, where the attributes are properties of the
function rather than a particular name of the function, and where the
compiler can see both declarations and the alias definition.)
--
Joseph S. Myers
joseph@codesourcery.com