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: musl - and menchmarking libc


On Wed, Sep 5, 2012 at 10:32 PM, Rich Felker wrote:
> On Thu, Sep 06, 2012 at 12:46:46AM +0000, Joseph S. Myers wrote:
>> > Step 2 is necessary to support conforming applications which declare
>> > LFS64-affected functions themselves rather than including the
>> > associated header (which, per ISO C and POSIX, is completely valid to
>> > do).
>>
>> The LFS functions are not part of POSIX, and ISO C and POSIX only allow
>> declaring the functions yourself if the function prototype purely involves
>> built-in C types rather than typedefs from standard headers, which also
>> excludes most but not all of these functions.
>
> I'm talking about -D_FILE_OFFSET_BITS=64, not -D_LARGEFILE64_SOURCE.
> The former is advertised by glibc as one of the POSIX compilation
> environments, one that provides _POSIX_V6_ILP32_OFFBIG, and it's the
> only compilation environment provided that any modern application
> should be using on a 32-bit machine. However, it's not actually a
> POSIX conforming environment since you can't reliably use these
> interfaces without including the headers that do the redirection
> (you'll instead call the 32-bit versions with the wrong prototypes,
> thus invoking UB), and since even when you do include the headers, you
> will pull in external symbol name pollution in the namespace reserved
> for the application.

on the first point (not including the header file), pretty sure POSIX
makes no such stipulation.  if you want the POSIX API, you must
include the appropriate header.  requiring implicit decls (or even
people copying & pasting the prototypes from the spec and putting
"extern" before it) to "work" is bunk.
-mike


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