[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Compiler warnings in dispnew.c
From: |
Po Lu |
Subject: |
Compiler warnings in dispnew.c |
Date: |
Sun, 28 Nov 2021 17:56:30 +0800 |
Building with checking, I get:
CC dispnew.o
In function ‘copy_row_except_pointers’,
inlined from ‘assign_row’ at dispnew.c:1050:3,
inlined from ‘mirror_make_current’ at dispnew.c:2761:3:
dispnew.c:1037:3: warning: ‘memcpy’ offset [48, 255] from the object at
‘current_row’ is out of the bounds of referenced subobject ‘x’ with type ‘int’
at offset 44 [-Warray-bounds]
1037 | memcpy (&to->x, &from->x, sizeof *to - off);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from termchar.h:23,
from dispnew.c:28:
dispnew.c: In function ‘mirror_make_current’:
dispextern.h:885:7: note: subobject ‘x’ declared here
885 | int x, y;
| ^
In function ‘copy_row_except_pointers’,
inlined from ‘assign_row’ at dispnew.c:1050:3,
inlined from ‘make_current’ at dispnew.c:2719:3:
dispnew.c:1037:3: warning: ‘memcpy’ offset [48, 255] from the object at
‘current_row’ is out of the bounds of referenced subobject ‘x’ with type ‘int’
at offset 44 [-Warray-bounds]
1037 | memcpy (&to->x, &from->x, sizeof *to - off);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from termchar.h:23,
from dispnew.c:28:
dispnew.c: In function ‘make_current’:
dispextern.h:885:7: note: subobject ‘x’ declared here
885 | int x, y;
| ^
In function ‘copy_row_except_pointers’,
inlined from ‘assign_row’ at dispnew.c:1050:3,
inlined from ‘scrolling_window’ at dispnew.c:4445:4,
inlined from ‘update_window’ at dispnew.c:3651:13:
dispnew.c:1037:3: warning: ‘memcpy’ offset [48, 255] from the object at ‘c’ is
out of the bounds of referenced subobject ‘x’ with type ‘int’ at offset 44
[-Warray-bounds]
1037 | memcpy (&to->x, &from->x, sizeof *to - off);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from termchar.h:23,
from dispnew.c:28:
dispnew.c: In function ‘update_window’:
dispextern.h:885:7: note: subobject ‘x’ declared here
885 | int x, y;
| ^
In function ‘copy_row_except_pointers’,
inlined from ‘assign_row’ at dispnew.c:1050:3,
inlined from ‘scrolling_window’ at dispnew.c:4768:6,
inlined from ‘update_window’ at dispnew.c:3651:13:
dispnew.c:1037:3: warning: ‘memcpy’ offset [48, 255] from the object at ‘to’ is
out of the bounds of referenced subobject ‘x’ with type ‘int’ at offset 44
[-Warray-bounds]
1037 | memcpy (&to->x, &from->x, sizeof *to - off);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from termchar.h:23,
from dispnew.c:28:
dispnew.c: In function ‘update_window’:
dispextern.h:885:7: note: subobject ‘x’ declared here
885 | int x, y;
I think it would be prudent to fix this, thanks.
- Compiler warnings in dispnew.c,
Po Lu <=
Re: Compiler warnings in dispnew.c, Eli Zaretskii, 2021/11/28