This is the mail archive of the 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: [PATCH] Add wcharP.h to hide internal wchar functions [BZ #18822]

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

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