Stricter checking for nsholder.c

Add the -Wextra -pedantic and -std=c99 flags when compiling the nsholder
test helper to get extra compiler checks, like we already use for the
main source code.

While we're there, fix some %d (signed) printf descriptors being used
for unsigned values (uid_t and gid_t).  Pointed out by cppcheck.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
David Gibson 2022-09-28 14:33:22 +10:00 committed by Stefano Brivio
parent a668d87e7e
commit df74984c52
2 changed files with 2 additions and 2 deletions

View file

@ -63,7 +63,7 @@ LOCAL_ASSETS = mbuto.img QEMU_EFI.fd \
ASSETS = $(DOWNLOAD_ASSETS) $(LOCAL_ASSETS) ASSETS = $(DOWNLOAD_ASSETS) $(LOCAL_ASSETS)
CFLAGS = -Wall -Werror CFLAGS = -Wall -Werror -Wextra -pedantic -std=c99
assets: $(ASSETS) assets: $(ASSETS)

View file

@ -53,7 +53,7 @@ static void hold(int fd, const struct sockaddr_un *addr)
if (rc < 0) if (rc < 0)
die("listen(): %s\n", strerror(errno)); die("listen(): %s\n", strerror(errno));
printf("nsholder: local PID=%d local UID=%d local GID=%d\n", printf("nsholder: local PID=%d local UID=%u local GID=%u\n",
getpid(), getuid(), getgid()); getpid(), getuid(), getgid());
do { do {
int afd = accept(fd, NULL, NULL); int afd = accept(fd, NULL, NULL);