[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compiler warnings in dispnew.c
From: |
Eli Zaretskii |
Subject: |
Re: Compiler warnings in dispnew.c |
Date: |
Sun, 28 Nov 2021 13:03:48 +0200 |
> Date: Sun, 28 Nov 2021 12:48:00 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: emacs-devel@gnu.org
>
> > From: Po Lu <luangruo@yahoo.com>
> > 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]
I don't understand the data the compiler prints, specifically why it
says "offset [48, 255]" and then "at offset 44".
If you put a breakpoint at line 2761 of mirror_make_current, and when it
breaks, type
(gdb) ptype /o current_row
(gdb) ptype /o desired_row
what do you see in offsets of x and in the total size of the
structure?
(Note: to hit the breakpoint, you need to invoke "emacs -Q -nw", the
"-nw" part is important.)
Re: Compiler warnings in dispnew.c,
Eli Zaretskii <=
Re: Compiler warnings in dispnew.c, Po Lu, 2021/11/28