bug-gnulib
[Top][All Lists]
Advanced

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

filemode: Add tests.


From: Collin Funk
Subject: filemode: Add tests.
Date: Tue, 18 Jun 2024 21:43:00 -0700
User-agent: Mozilla Thunderbird

I ran into a compilation error a long time ago (not Gnulib related)
because I declared strmode using the mode_t argument unconditionally.
This is an issue because FreeBSD uses int as the first argument and
not mode_t, which is typedef'd to __uint16_t. This test is mostly to
make sure that doesn't happen due to this module. I've added some
basic functionality tests too.

NetBSD fixed that declaration in 1997 [1], FreeBSD did in version
14.0 [2]. OpenBSD still has it declared with an int argument even
though mode_t is a __uint32_t there [3] [4] [5].

Collin

[1] 
https://github.com/NetBSD/src/commit/3664382e532de079a7dc0f9430d55ce2419af50d
[2] 
https://github.com/freebsd/freebsd-src/commit/849dcdb1c0c50b13f97d67c912f0edac82688281
[3] 
https://github.com/openbsd/src/blob/1245b84dd8b155eea7f3aeffc9acb78e7116673b/include/string.h#L131
[4] 
https://github.com/openbsd/src/blob/1245b84dd8b155eea7f3aeffc9acb78e7116673b/sys/sys/_types.h#L54
[5] https://man.openbsd.org/strmode.3

Attachment: 0001-filemode-Add-tests.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]