You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In function ‘ptrack_write_chunk’,
inlined from ‘ptrackCheckpoint’ at engine.c:397:2:
engine.c:78:13: warning: ‘write’ reading 8 bytes from a region of size 4
[-Wstringop-overread]
78 | if (write(fd, chunk, size) != size)
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from engine.c:47:
engine.c: In function ‘ptrackCheckpoint’:
engine.h:55:25: note: source object ‘magic’ of size 4
55 | char magic[PTRACK_MAGIC_SIZE];
| ^~~~~
In file included from engine.c:22:
/usr/include/unistd.h:378:16: note: in a call to function ‘write’ declared with
attribute ‘access (read_only, 2, 3)’
378 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
| ^~~~~
To avoid changing other code for the fields magic and version_num in the
structure PtrackMapHdr, use two calls to ptrack_write_chunk to write them to the
file. (This function is called a few times later, so why not add another call?)
Add a compile-time assertion check that nothing has actually changed (e.g.
alignment is fine).
0 commit comments