Closed rgmiller closed 1 year ago
Good catch. I think maybe that buf
was intended for this parameter instead of "a"
?
That buffer is initialized to all zeros. Is that sufficient for this test? Or should we have different values in that buffer?
Also, the code uses the literal 300 in a couple of different places. Should we replace that with a #define
or const int
?
@rgmiller Based on what it's testing, I don't think the zeroes are a problem. I agree that we should use a constant or #define for the buffer size.
System information
Describe the problem you're observing
https://github.com/LLNL/UnifyFS/blob/f95abed7c1aa91864d047b7c0ad38ac05e5719a7/t/sys/write-read.c#L379
The call to
write()
on this line specifies a count of 300, but the data to be written is only 2 bytes long. Newer versions of gcc (at least 11.3.0, possibly somewhat earlier) will issue a warning about this. And by default, we build with-Werror
enabled, so the warning turns into an error and the build stops.Temporary work-around is to compile with
-Wno-error=stringop-overread
.Describe how to reproduce the problem
Just look at the code.
Include any warning or errors or releveant debugging data
The exact error from GCC: