Open mm1ke opened 1 week ago
I wonder if OpenBSD has these warnings too 🤔
This could be a false positive, maybe GCC doesn't understand that the free() is conditional:
int
shf_snprintf(char *buf, int bsize, const char *fmt, ...)
{
[...]
shf_sopen(buf, bsize, SHF_WR, &shf); <== passes &shf, not NULL
[...]
struct shf *
shf_sopen(char *buf, int bsize, int sflags, struct shf *shf)
{
[...]
if (!shf) { <== this is false, so SHF_ALLOCS is not set
shf = alloc(sizeof(struct shf), ATEMP);
sflags |= SHF_ALLOCS;
}
[...]
if (shf->flags & SHF_ALLOCS) <== therefore this is false and free() is not called
afree(shf, shf->areap);
Hi,
I'm trying to update
loksh
on gentoo to the latest version. However i'm seeing compiler warnings when building it:I'm using gcc-14 as compiler. Is this something which could be fixed?