On 18/09/2025 21:34, Bruno Haible wrote:
The compilers on FreeBSD 11 and OpenBSD 7.6 (at least) report give this
warning:

../src/copy-file-data.c:585:7: warning: variable 'result' is used uninitialized 
whenever 'if' condition is false [-Wsometimes-uninitialized]

There is an 'assume (scantype != LSEEK_SCANTYPE);' in line 582,
that is apparently supposed to teach the compiler about the
control flow. But still, even as a human reader I find this code
hard to understand. How about this patch? I have verified that
it silences the warning on both FreeBSD and OpenBSD.

The logic looks fine, but then we hit -Werror=switch-enum issues with gcc.
I'll apply this after release I think.

Reply via email to