- Notifications
You must be signed in to change notification settings - Fork16
Commit033471d

Marina Polyakova
PGPRO-5646: remove compiler warning (gcc 11.2.0)
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 withattribute ‘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 thestructure PtrackMapHdr, use two calls to ptrack_write_chunk to write them to thefile. (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).1 parent3d6ccc6 commit033471d
1 file changed
+14
-3
lines changedLines changed: 14 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
391 | 391 |
| |
392 | 392 |
| |
393 | 393 |
| |
394 |
| - | |
395 |
| - | |
396 | 394 |
| |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
397 | 406 |
| |
398 |
| - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
399 | 410 |
| |
400 | 411 |
| |
401 | 412 |
| |
|
0 commit comments
Comments
(0)