On 32bit arches where time_t is defined as long int and where
sizeof(long)==sizeof(int), PRI_TIME is PRIu32 which is "u" and gcc warns about
ignoring the long part of the integer type. There is no problem besides the
warning.
Upcast time_t to 64bit and get rid of PRI_TIME and configure checks
udevadm-monitor.c: In function ‘print_device’:
udevadm-monitor.c:49:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘__time_t’ {aka ‘long int’} [-Wformat=]
49 | printf("%-6s[%"PRI_TIME".%06ld] %-8s %s (%s)\n",
| ^~~~~~~~
50 | source,
51 | ts.tv_sec, ts.tv_nsec/1000,
| ~~~~~~~~~
| |
| __time_t {aka long int}
In file included from ../../src/shared/macro.h:26,
from udev.h:26,
from udevadm-monitor.c:35:
/usr/include/inttypes.h:104:19: note: format string is defined here
104 | # define PRIu32 "u"
On 32bit arches where time_t is defined as long int and where
sizeof(long)==sizeof(int), PRI_TIME is PRIu32 which is "u" and gcc warns about
ignoring the long part of the integer type. There is no problem besides the
warning.
Use "lu" in the above conditions and PRIu32 in all other 32bit time_t cases.
udevadm-monitor.c: In function ‘print_device’:
udevadm-monitor.c:49:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘__time_t’ {aka ‘long int’} [-Wformat=]
49 | printf("%-6s[%"PRI_TIME".%06ld] %-8s %s (%s)\n",
| ^~~~~~~~
50 | source,
51 | ts.tv_sec, ts.tv_nsec/1000,
| ~~~~~~~~~
| |
| __time_t {aka long int}
In file included from ../../src/shared/macro.h:26,
from udev.h:26,
from udevadm-monitor.c:35:
/usr/include/inttypes.h:104:19: note: format string is defined here
104 | # define PRIu32 "u"
g-i-r support was removed in 2015 as part of removal of Gobject libudev
support, but the autoconf support wasn't removed but is dead.
Fixes: 252150e181 ("src/gudev: remove Gobject libudev support.")
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Alex Kiernan <alexk@zuma.ai>
Fixes `test: too many arguments` when building Linux-PAM using sbase.
This is due to a non-POSIX syntax test ... -a ... and test ... -o ....
> The XSI extensions specifying the -a and -o binary primaries and the
> '(' and ')' operators have been marked obsolescent.
See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
This fixes#182 by ensuring @bindir@ is fully expanded at installation
time. See "Installation Directory Variables" in the GNU Autoconf
manual, in particular the note about AC_CONFIG_FILES.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
In some cases (e.g. trimmed-down chroot or containers), libudev is the
only thing needed, with udevd and assorted programs totally useless
(e.g. because /dev is bind-mounted from the real one and managed
out-side the chroot/container).
Add an option to ./configure to enable/disable building the programs;
this option defaults to "enable", so that it is backward compatible with
existing build procedure, and because it by default makes sense to have
udevd et al.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
mallinfo is not specified by POSIX or the C standards, therefore
it's not available for all libc libraries (musl).
Add the ability to disable mallinfo statistics.
Fixes:
selinux-util.c: In function ‘mac_selinux_init’:
selinux-util.c:70:25: error: storage size of ‘before_mallinfo’ isn’t known
struct mallinfo before_mallinfo, after_mallinfo;
Signed-off-by: Romain Naour <romain.naour@openwide.fr>