From a30c4ab397af040d10d978d97dd4a6835d4b99a8 Mon Sep 17 00:00:00 2001 From: "Alex Xu (Hello71)" Date: Sun, 2 Jul 2023 20:54:45 -0400 Subject: [PATCH 3/4] fix mismatched VLA parameter types gcc warns about this, and it's probably technically UB --- src/internal/procfdname.c | 2 +- src/prng/seed48.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/internal/procfdname.c b/src/internal/procfdname.c index fd7306ab..bfa3e7e5 100644 --- a/src/internal/procfdname.c +++ b/src/internal/procfdname.c @@ -1,6 +1,6 @@ #include "syscall.h" -void __procfdname(char *buf, unsigned fd) +void __procfdname(char buf[static 15+3*sizeof(int)], unsigned fd) { unsigned i, j; for (i=0; (buf[i] = "/proc/self/fd/"[i]); i++); diff --git a/src/prng/seed48.c b/src/prng/seed48.c index bce7b339..7b789086 100644 --- a/src/prng/seed48.c +++ b/src/prng/seed48.c @@ -2,7 +2,7 @@ #include #include "rand48.h" -unsigned short *seed48(unsigned short *s) +unsigned short *seed48(unsigned short s[3]) { static unsigned short p[3]; memcpy(p, __seed48, sizeof p); -- 2.41.0