Re: [PATCH] Various pages: Remove unused <sys/types.h>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Joseph,

On 3/15/21 7:25 PM, Joseph Myers wrote:
> On Sun, 14 Mar 2021, Zack Weinberg wrote:
> 
>> I endorse this change.  For glibc, if the header file containing the
>> function prototype doesn't also provide everything you need to call
>> the function, it's a bug (except for a few cases where the relevant
>> standards prevent us from doing this, e.g. a function that calls
>> vprintf will need the macros in <stdarg.h>, but the C standard
>> specifically forbids <stdio.h> to include <stdarg.h>).
> 
> And in particular, where older POSIX doesn't require the types used in the 
> function declarations to be defined by a header, but permits them to be 
> defined by virtue of the general *_t reservation in POSIX (that's not in 
> ISO C), it's appropriate to define those types whenever declaring 
> functions that use them, rather than only for the newer POSIX versions 
> that require those types to be defined alongside declaring the functions 
> that use them.  (So we could simplify some of the conditionals in unistd.h 
> and remove the "# define uid_t __uid_t" and similar hacks in 
> conform/data/unistd.h-data, for example.)


If you plan to do that (simplify glibc), maybe the changes I'm doing
right now may help you.  It'll take me a few months to complete, but I
plan to further clean the includes in the SYNOPSIS of man[23], so that
only the include that provides the prototype is listed, and if any other
headers are needed, they'll have an explicit comment about why.

After that is merged, you should be able to list all the SYNOPSIS of
man[23] (check our <scripts/bash_aliases> for that) and see which
specify more than one header (and therefore you'll be able to check if a
standard requires it, or if it's a bug in glibc).  I'll CC you both when
I push those changes.

Cheers,

Alex

-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux