mailing list of musl libc
 help / color / mirror / code / Atom feed
* Header conformance/improvements
@ 2016-10-11 22:44 Daniel Sabogal
  2016-10-20 21:30 ` Rich Felker
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Sabogal @ 2016-10-11 22:44 UTC (permalink / raw)
  To: musl

Here's a list of observations from musl's headers.

namespace/feature testing
-------------------------
dirent.h:36-7: (seek|tell)dir - XSI
grp.h:32-4: (get|end|set)grent - XSI
pwd.h:30-2: (set|end|get)pwent - XSI
stdlib.h:103: mkostemp - GNU
sys/stat.h:82,85: mknod[at] - XSI
sys/time.h:13-29: sys/time.h - XSI header
time.h:121: tzname - base, not XSI
unistd.h:113,116: setre(uid|gid) - XSI
wchar.h:70: wcswcs - issue 6 XSI and wcs[a-z], but removed

misc
----
stdlib.h:155-8:
glibc provides locale_t under _GNU_SOURCE. maybe it should
be provided and used in place of struct __locale_struct.

string.h:88:
gcc generates an implicit-function-declaration warning from alloca
when using strdupa. aside: glibc also provides strndupa.

parameter names
---------------
grp.h:37: stream
ifaddrs.h:27,28: ifp, ifap
stdlib.h:42: alignment, size
sys/xattr.h:16,19: filedes
threads.h:78: key
wchar.h:56,168: n

typos
-----
sys/param.h:10: CANBSIZE -> CANBSIZ
utmpx.h:41: | -> ||


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Header conformance/improvements
  2016-10-11 22:44 Header conformance/improvements Daniel Sabogal
@ 2016-10-20 21:30 ` Rich Felker
  2016-10-20 23:19   ` Daniel Sabogal
  0 siblings, 1 reply; 4+ messages in thread
From: Rich Felker @ 2016-10-20 21:30 UTC (permalink / raw)
  To: musl

On Tue, Oct 11, 2016 at 06:44:14PM -0400, Daniel Sabogal wrote:
> Here's a list of observations from musl's headers.
> 
> namespace/feature testing
> -------------------------
> dirent.h:36-7: (seek|tell)dir - XSI
> grp.h:32-4: (get|end|set)grent - XSI
> pwd.h:30-2: (set|end|get)pwent - XSI

Fixing.

> stdlib.h:103: mkostemp - GNU

POSIX-future, so no change.

> sys/stat.h:82,85: mknod[at] - XSI

Fixing.

> sys/time.h:13-29: sys/time.h - XSI header

Not sure what you mean here. If the whole header is XSI there's no
obligation to check FTMs; a conforming non-XSI program doesn't include
it.

> time.h:121: tzname - base, not XSI
> unistd.h:113,116: setre(uid|gid) - XSI

Fixing.

> wchar.h:70: wcswcs - issue 6 XSI and wcs[a-z], but removed

Leaving it alone for now since it's in a reserved namespace, but we
can revisit this desired.

> misc
> ----
> stdlib.h:155-8:
> glibc provides locale_t under _GNU_SOURCE. maybe it should
> be provided and used in place of struct __locale_struct.

Do you have in mind a scenario where this would be useful, i.e. where
you might need locale_t to be defined but not have included another
header that defines it?

> string.h:88:
> gcc generates an implicit-function-declaration warning from alloca
> when using strdupa. aside: glibc also provides strndupa.

We discussed making this definition depend on __GNUC__ and then it
could use __builtin_alloca and GCC extensions needed to make strndupa
work. There might be an old patch floating around to do something like
that.

> parameter names
> ---------------
> grp.h:37: stream
> ifaddrs.h:27,28: ifp, ifap
> stdlib.h:42: alignment, size
> sys/xattr.h:16,19: filedes
> threads.h:78: key
> wchar.h:56,168: n

Fixing.

> typos
> -----
> sys/param.h:10: CANBSIZE -> CANBSIZ
> utmpx.h:41: | -> ||

Fixing.

Rich


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Header conformance/improvements
  2016-10-20 21:30 ` Rich Felker
@ 2016-10-20 23:19   ` Daniel Sabogal
  2016-11-07 16:50     ` Rich Felker
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Sabogal @ 2016-10-20 23:19 UTC (permalink / raw)
  To: musl

On Thu, Oct 20, 2016 at 5:30 PM, Rich Felker <dalias@libc.org> wrote:
> On Tue, Oct 11, 2016 at 06:44:14PM -0400, Daniel Sabogal wrote:
>> namespace/feature testing
>> -------------------------
>> sys/time.h:13-29: sys/time.h - XSI header
>
> Not sure what you mean here. If the whole header is XSI there's no
> obligation to check FTMs; a conforming non-XSI program doesn't include
> it.

Sorry, I should have been more descriptive with this one. The issue here is
that there are unnecessary checks for _XOPEN_SOURCE.

>> misc
>> ----
>> stdlib.h:155-8:
>> glibc provides locale_t under _GNU_SOURCE. maybe it should
>> be provided and used in place of struct __locale_struct.
>
> Do you have in mind a scenario where this would be useful, i.e. where
> you might need locale_t to be defined but not have included another
> header that defines it?

I was really only thinking along the lines of keeping it consistent with
how all other headers provide locale_t via __NEED_locale_t.
I don't believe there are any real benefits and that any software package
already doing this should be easily patch-able.

>> string.h:88:
>> gcc generates an implicit-function-declaration warning from alloca
>> when using strdupa. aside: glibc also provides strndupa.
>
> We discussed making this definition depend on __GNUC__ and then it
> could use __builtin_alloca and GCC extensions needed to make strndupa
> work. There might be an old patch floating around to do something like
> that.

OK.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Header conformance/improvements
  2016-10-20 23:19   ` Daniel Sabogal
@ 2016-11-07 16:50     ` Rich Felker
  0 siblings, 0 replies; 4+ messages in thread
From: Rich Felker @ 2016-11-07 16:50 UTC (permalink / raw)
  To: musl

On Thu, Oct 20, 2016 at 07:19:50PM -0400, Daniel Sabogal wrote:
> On Thu, Oct 20, 2016 at 5:30 PM, Rich Felker <dalias@libc.org> wrote:
> > On Tue, Oct 11, 2016 at 06:44:14PM -0400, Daniel Sabogal wrote:
> >> namespace/feature testing
> >> -------------------------
> >> sys/time.h:13-29: sys/time.h - XSI header
> >
> > Not sure what you mean here. If the whole header is XSI there's no
> > obligation to check FTMs; a conforming non-XSI program doesn't include
> > it.
> 
> Sorry, I should have been more descriptive with this one. The issue here is
> that there are unnecessary checks for _XOPEN_SOURCE.

OK, thanks for catching that. Fixing.

Rich


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-07 16:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-11 22:44 Header conformance/improvements Daniel Sabogal
2016-10-20 21:30 ` Rich Felker
2016-10-20 23:19   ` Daniel Sabogal
2016-11-07 16:50     ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).