unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* scratch/igc warning
@ 2024-06-26 14:08 Andrea Corallo
  2024-06-26 14:31 ` Pip Cet
  2024-06-26 14:39 ` Gerd Möllmann
  0 siblings, 2 replies; 12+ messages in thread
From: Andrea Corallo @ 2024-06-26 14:08 UTC (permalink / raw)
  To: emacs-devel; +Cc: Gerd Möllmann

Hi,

GCC 12.3 is giving me this warning building scratch/igc:

========
  CC       xfaces.o
In file included from /usr/include/string.h:535,
                 from ../lib/string.h:41,
                 from lisp.h:29,
                 from xfaces.c:226:
In function ‘memset’,
    inlined from ‘make_realized_face’ at xfaces.c:4581:3,
    inlined from ‘realize_gui_face’ at xfaces.c:6214:10,
    inlined from ‘realize_face’ at xfaces.c:6124:12:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:59:10: warning: ‘__builtin_memset’ offset [164, 303] from the object at ‘face’ is out of the bounds of referenced subobject ‘id’ with type ‘int’ at offset 160 [-Warray-bounds]
   59 |   return __builtin___memset_chk (__dest, __ch, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   60 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from termhooks.h:27,
                 from frame.h:22,
                 from xfaces.c:229:
dispextern.h: In function ‘realize_face’:
dispextern.h:1730:7: note: subobject ‘id’ declared here
 1730 |   int id;
      |       ^~
In function ‘memset’,
    inlined from ‘make_realized_face’ at xfaces.c:4581:3,
    inlined from ‘realize_tty_face’ at xfaces.c:6641:10,
    inlined from ‘realize_face’ at xfaces.c:6126:12:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:59:10: warning: ‘__builtin_memset’ offset [164, 303] from the object at ‘face’ is out of the bounds of referenced subobject ‘id’ with type ‘int’ at offset 160 [-Warray-bounds]
   59 |   return __builtin___memset_chk (__dest, __ch, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   60 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
dispextern.h: In function ‘realize_face’:
dispextern.h:1730:7: note: subobject ‘id’ declared here
 1730 |   int id;
      |       ^~
In function ‘memset’,
    inlined from ‘make_realized_face’ at xfaces.c:4581:3,
    inlined from ‘realize_face’ at xfaces.c:6130:14:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:59:10: warning: ‘__builtin_memset’ offset [164, 303] from the object at ‘face’ is out of the bounds of referenced subobject ‘id’ with type ‘int’ at offset 160 [-Warray-bounds]
   59 |   return __builtin___memset_chk (__dest, __ch, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   60 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
dispextern.h: In function ‘realize_face’:
dispextern.h:1730:7: note: subobject ‘id’ declared here
 1730 |   int id;
      |       ^~
========

ATM don't know if it's a real issue or a false positive so I thought was
worth mentioning.

  Andrea



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: scratch/igc warning
  2024-06-26 14:08 scratch/igc warning Andrea Corallo
@ 2024-06-26 14:31 ` Pip Cet
  2024-06-26 14:43   ` Andrea Corallo
  2024-06-26 14:39 ` Gerd Möllmann
  1 sibling, 1 reply; 12+ messages in thread
From: Pip Cet @ 2024-06-26 14:31 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: emacs-devel, Gerd Möllmann

On Wednesday, June 26th, 2024 at 14:08, Andrea Corallo <acorallo@gnu.org> wrote:

> GCC 12.3 is giving me this warning building scratch/igc:
> 
> ========
> CC xfaces.o
> In file included from /usr/include/string.h:535,
> from ../lib/string.h:41,
> from lisp.h:29,
> from xfaces.c:226:
> In function ‘memset’,
> inlined from ‘make_realized_face’ at xfaces.c:4581:3,
> inlined from ‘realize_gui_face’ at xfaces.c:6214:10,
> inlined from ‘realize_face’ at xfaces.c:6124:12:
> /usr/include/x86_64-linux-gnu/bits/string_fortified.h:59:10: warning: ‘__builtin_memset’ offset [164, 303] from the object at ‘face’ is out of the bounds of referenced subobject ‘id’ with type ‘int’ at offset 160 [-Warray-bounds]
> 59 | return __builtin___memset_chk (__dest, __ch, __len,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 60 | __glibc_objsize0 (__dest));
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from termhooks.h:27,
> from frame.h:22,
> from xfaces.c:229:
> dispextern.h: In function ‘realize_face’:
> dispextern.h:1730:7: note: subobject ‘id’ declared here
> 1730 | int id;
> | ^~
> In function ‘memset’,
> inlined from ‘make_realized_face’ at xfaces.c:4581:3,
> inlined from ‘realize_tty_face’ at xfaces.c:6641:10,
> inlined from ‘realize_face’ at xfaces.c:6126:12:
> /usr/include/x86_64-linux-gnu/bits/string_fortified.h:59:10: warning: ‘__builtin_memset’ offset [164, 303] from the object at ‘face’ is out of the bounds of referenced subobject ‘id’ with type ‘int’ at offset 160 [-Warray-bounds]
> 59 | return __builtin___memset_chk (__dest, __ch, __len,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 60 | __glibc_objsize0 (__dest));
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~
> dispextern.h: In function ‘realize_face’:
> dispextern.h:1730:7: note: subobject ‘id’ declared here
> 1730 | int id;
> | ^~
> In function ‘memset’,
> inlined from ‘make_realized_face’ at xfaces.c:4581:3,
> inlined from ‘realize_face’ at xfaces.c:6130:14:
> /usr/include/x86_64-linux-gnu/bits/string_fortified.h:59:10: warning: ‘__builtin_memset’ offset [164, 303] from the object at ‘face’ is out of the bounds of referenced subobject ‘id’ with type ‘int’ at offset 160 [-Warray-bounds]
> 59 | return __builtin___memset_chk (__dest, __ch, __len,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 60 | __glibc_objsize0 (__dest));
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~
> dispextern.h: In function ‘realize_face’:
> dispextern.h:1730:7: note: subobject ‘id’ declared here
> 1730 | int id;
> | ^~
> ========
> 
> ATM don't know if it's a real issue or a false positive so I thought was
> worth mentioning.

Something in between: the code is trying to clear a struct partially by memsetting starting from a given offset to the end of the struct. However, it's not specific to the igc branch.

Pip



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: scratch/igc warning
  2024-06-26 14:08 scratch/igc warning Andrea Corallo
  2024-06-26 14:31 ` Pip Cet
@ 2024-06-26 14:39 ` Gerd Möllmann
  2024-06-26 14:48   ` Andrea Corallo
  1 sibling, 1 reply; 12+ messages in thread
From: Gerd Möllmann @ 2024-06-26 14:39 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: emacs-devel

Andrea Corallo <acorallo@gnu.org> writes:

> Hi,
>
> GCC 12.3 is giving me this warning building scratch/igc:
>
> ========
>   CC       xfaces.o
> In file included from /usr/include/string.h:535,
>                  from ../lib/string.h:41,
>                  from lisp.h:29,
>                  from xfaces.c:226:
> In function ‘memset’,
>     inlined from ‘make_realized_face’ at xfaces.c:4581:3,
>     inlined from ‘realize_gui_face’ at xfaces.c:6214:10,
>     inlined from ‘realize_face’ at xfaces.c:6124:12:
> /usr/include/x86_64-linux-gnu/bits/string_fortified.h:59:10: warning: ‘__builtin_memset’ offset [164, 303] from the object at ‘face’ is out of the bounds of referenced subobject ‘id’ with type ‘int’ at offset 160 [-Warray-bounds]
>    59 |   return __builtin___memset_chk (__dest, __ch, __len,
>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    60 |                                  __glibc_objsize0 (__dest));
>       |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from termhooks.h:27,
>                  from frame.h:22,
>                  from xfaces.c:229:
> dispextern.h: In function ‘realize_face’:
> dispextern.h:1730:7: note: subobject ‘id’ declared here
>  1730 |   int id;
>       |       ^~
> In function ‘memset’,
>     inlined from ‘make_realized_face’ at xfaces.c:4581:3,
>     inlined from ‘realize_tty_face’ at xfaces.c:6641:10,
>     inlined from ‘realize_face’ at xfaces.c:6126:12:
> /usr/include/x86_64-linux-gnu/bits/string_fortified.h:59:10: warning: ‘__builtin_memset’ offset [164, 303] from the object at ‘face’ is out of the bounds of referenced subobject ‘id’ with type ‘int’ at offset 160 [-Warray-bounds]
>    59 |   return __builtin___memset_chk (__dest, __ch, __len,
>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    60 |                                  __glibc_objsize0 (__dest));
>       |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
> dispextern.h: In function ‘realize_face’:
> dispextern.h:1730:7: note: subobject ‘id’ declared here
>  1730 |   int id;
>       |       ^~
> In function ‘memset’,
>     inlined from ‘make_realized_face’ at xfaces.c:4581:3,
>     inlined from ‘realize_face’ at xfaces.c:6130:14:
> /usr/include/x86_64-linux-gnu/bits/string_fortified.h:59:10: warning: ‘__builtin_memset’ offset [164, 303] from the object at ‘face’ is out of the bounds of referenced subobject ‘id’ with type ‘int’ at offset 160 [-Warray-bounds]
>    59 |   return __builtin___memset_chk (__dest, __ch, __len,
>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    60 |                                  __glibc_objsize0 (__dest));
>       |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
> dispextern.h: In function ‘realize_face’:
> dispextern.h:1730:7: note: subobject ‘id’ declared here
>  1730 |   int id;
>       |       ^~
> ========
>
> ATM don't know if it's a real issue or a false positive so I thought was
> worth mentioning.

Hm, that's this one, right?

  static struct face *
  make_realized_face (Lisp_Object *attr)
  {
    enum { off = offsetof (struct face, id) };
  #ifdef HAVE_MPS
    struct face *face = igc_make_face ();
  #else
    struct face *face = xmalloc (sizeof *face);
  #endif
    memcpy (face->lface, attr, sizeof face->lface);
    memset (&face->id, 0, sizeof *face - off);
    face->ascii_face = face;

    return face;
  }

which we can rewrite, for MPS

  static struct face *
  make_realized_face (Lisp_Object *attr)
  {
  #ifdef HAVE_MPS
    struct face *face = igc_make_face ();
    memcpy (face->lface, attr, sizeof face->lface);
  #else
    enum { off = offsetof (struct face, id) };
    struct face *face = xmalloc (sizeof *face);
    memcpy (face->lface, attr, sizeof face->lface);
    memset (&face->id, 0, sizeof *face - off);
  #endif
    face->ascii_face = face;

    return face;
  }

because igc returns something zero-initialized anyway. (I'll do that.).

But I wonder - does GCC 12 also complain for the non-MPS case?



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: scratch/igc warning
  2024-06-26 14:31 ` Pip Cet
@ 2024-06-26 14:43   ` Andrea Corallo
  2024-06-26 15:45     ` Pip Cet
  0 siblings, 1 reply; 12+ messages in thread
From: Andrea Corallo @ 2024-06-26 14:43 UTC (permalink / raw)
  To: Pip Cet; +Cc: emacs-devel, Gerd Möllmann

Pip Cet <pipcet@protonmail.com> writes:

> On Wednesday, June 26th, 2024 at 14:08, Andrea Corallo <acorallo@gnu.org> wrote:
>
>> GCC 12.3 is giving me this warning building scratch/igc:
>> 
>> ========
>> CC xfaces.o
>> In file included from /usr/include/string.h:535,
>> from ../lib/string.h:41,
>> from lisp.h:29,
>> from xfaces.c:226:
>> In function ‘memset’,
>> inlined from ‘make_realized_face’ at xfaces.c:4581:3,
>> inlined from ‘realize_gui_face’ at xfaces.c:6214:10,
>> inlined from ‘realize_face’ at xfaces.c:6124:12:
>> /usr/include/x86_64-linux-gnu/bits/string_fortified.h:59:10: warning: ‘__builtin_memset’ offset [164, 303] from the object at ‘face’ is out of the bounds of referenced subobject ‘id’ with type ‘int’ at offset 160 [-Warray-bounds]
>> 59 | return __builtin___memset_chk (__dest, __ch, __len,
>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> 60 | __glibc_objsize0 (__dest));
>> | ~~~~~~~~~~~~~~~~~~~~~~~~~~
>> In file included from termhooks.h:27,
>> from frame.h:22,
>> from xfaces.c:229:
>> dispextern.h: In function ‘realize_face’:
>> dispextern.h:1730:7: note: subobject ‘id’ declared here
>> 1730 | int id;
>> | ^~
>> In function ‘memset’,
>> inlined from ‘make_realized_face’ at xfaces.c:4581:3,
>> inlined from ‘realize_tty_face’ at xfaces.c:6641:10,
>> inlined from ‘realize_face’ at xfaces.c:6126:12:
>> /usr/include/x86_64-linux-gnu/bits/string_fortified.h:59:10: warning: ‘__builtin_memset’ offset [164, 303] from the object at ‘face’ is out of the bounds of referenced subobject ‘id’ with type ‘int’ at offset 160 [-Warray-bounds]
>> 59 | return __builtin___memset_chk (__dest, __ch, __len,
>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> 60 | __glibc_objsize0 (__dest));
>> | ~~~~~~~~~~~~~~~~~~~~~~~~~~
>> dispextern.h: In function ‘realize_face’:
>> dispextern.h:1730:7: note: subobject ‘id’ declared here
>> 1730 | int id;
>> | ^~
>> In function ‘memset’,
>> inlined from ‘make_realized_face’ at xfaces.c:4581:3,
>> inlined from ‘realize_face’ at xfaces.c:6130:14:
>> /usr/include/x86_64-linux-gnu/bits/string_fortified.h:59:10: warning: ‘__builtin_memset’ offset [164, 303] from the object at ‘face’ is out of the bounds of referenced subobject ‘id’ with type ‘int’ at offset 160 [-Warray-bounds]
>> 59 | return __builtin___memset_chk (__dest, __ch, __len,
>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> 60 | __glibc_objsize0 (__dest));
>> | ~~~~~~~~~~~~~~~~~~~~~~~~~~
>> dispextern.h: In function ‘realize_face’:
>> dispextern.h:1730:7: note: subobject ‘id’ declared here
>> 1730 | int id;
>> | ^~
>> ========
>> 
>> ATM don't know if it's a real issue or a false positive so I thought was
>> worth mentioning.
>
> Something in between: the code is trying to clear a struct partially by memsetting starting from a given offset to the end of the struct. However, it's not specific to the igc branch.

I believe it is, I don't see it in my other builds.

  Andrea



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: scratch/igc warning
  2024-06-26 14:39 ` Gerd Möllmann
@ 2024-06-26 14:48   ` Andrea Corallo
  2024-06-26 14:57     ` Gerd Möllmann
  0 siblings, 1 reply; 12+ messages in thread
From: Andrea Corallo @ 2024-06-26 14:48 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: emacs-devel

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> Andrea Corallo <acorallo@gnu.org> writes:
>
>> Hi,
>>
>> GCC 12.3 is giving me this warning building scratch/igc:
>>
>> ========
>>   CC       xfaces.o
>> In file included from /usr/include/string.h:535,
>>                  from ../lib/string.h:41,
>>                  from lisp.h:29,
>>                  from xfaces.c:226:
>> In function ‘memset’,
>>     inlined from ‘make_realized_face’ at xfaces.c:4581:3,
>>     inlined from ‘realize_gui_face’ at xfaces.c:6214:10,
>>     inlined from ‘realize_face’ at xfaces.c:6124:12:
>> /usr/include/x86_64-linux-gnu/bits/string_fortified.h:59:10: warning: ‘__builtin_memset’ offset [164, 303] from the object at ‘face’ is out of the bounds of referenced subobject ‘id’ with type ‘int’ at offset 160 [-Warray-bounds]
>>    59 |   return __builtin___memset_chk (__dest, __ch, __len,
>>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>    60 |                                  __glibc_objsize0 (__dest));
>>       |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
>> In file included from termhooks.h:27,
>>                  from frame.h:22,
>>                  from xfaces.c:229:
>> dispextern.h: In function ‘realize_face’:
>> dispextern.h:1730:7: note: subobject ‘id’ declared here
>>  1730 |   int id;
>>       |       ^~
>> In function ‘memset’,
>>     inlined from ‘make_realized_face’ at xfaces.c:4581:3,
>>     inlined from ‘realize_tty_face’ at xfaces.c:6641:10,
>>     inlined from ‘realize_face’ at xfaces.c:6126:12:
>> /usr/include/x86_64-linux-gnu/bits/string_fortified.h:59:10: warning: ‘__builtin_memset’ offset [164, 303] from the object at ‘face’ is out of the bounds of referenced subobject ‘id’ with type ‘int’ at offset 160 [-Warray-bounds]
>>    59 |   return __builtin___memset_chk (__dest, __ch, __len,
>>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>    60 |                                  __glibc_objsize0 (__dest));
>>       |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
>> dispextern.h: In function ‘realize_face’:
>> dispextern.h:1730:7: note: subobject ‘id’ declared here
>>  1730 |   int id;
>>       |       ^~
>> In function ‘memset’,
>>     inlined from ‘make_realized_face’ at xfaces.c:4581:3,
>>     inlined from ‘realize_face’ at xfaces.c:6130:14:
>> /usr/include/x86_64-linux-gnu/bits/string_fortified.h:59:10: warning: ‘__builtin_memset’ offset [164, 303] from the object at ‘face’ is out of the bounds of referenced subobject ‘id’ with type ‘int’ at offset 160 [-Warray-bounds]
>>    59 |   return __builtin___memset_chk (__dest, __ch, __len,
>>       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>    60 |                                  __glibc_objsize0 (__dest));
>>       |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
>> dispextern.h: In function ‘realize_face’:
>> dispextern.h:1730:7: note: subobject ‘id’ declared here
>>  1730 |   int id;
>>       |       ^~
>> ========
>>
>> ATM don't know if it's a real issue or a false positive so I thought was
>> worth mentioning.
>
> Hm, that's this one, right?
>
>   static struct face *
>   make_realized_face (Lisp_Object *attr)
>   {
>     enum { off = offsetof (struct face, id) };
>   #ifdef HAVE_MPS
>     struct face *face = igc_make_face ();
>   #else
>     struct face *face = xmalloc (sizeof *face);
>   #endif
>     memcpy (face->lface, attr, sizeof face->lface);
>     memset (&face->id, 0, sizeof *face - off);
>     face->ascii_face = face;
>
>     return face;
>   }
>
> which we can rewrite, for MPS
>
>   static struct face *
>   make_realized_face (Lisp_Object *attr)
>   {
>   #ifdef HAVE_MPS
>     struct face *face = igc_make_face ();
>     memcpy (face->lface, attr, sizeof face->lface);
>   #else
>     enum { off = offsetof (struct face, id) };
>     struct face *face = xmalloc (sizeof *face);
>     memcpy (face->lface, attr, sizeof face->lface);
>     memset (&face->id, 0, sizeof *face - off);
>   #endif
>     face->ascii_face = face;
>
>     return face;
>   }
>
> because igc returns something zero-initialized anyway. (I'll do that.).

Yep this clean the warning!

> But I wonder - does GCC 12 also complain for the non-MPS case?

It does not, my other tracked branches (master and emacs-30) are now
warning clean here with similar configurations.

With this fix scratch/igc will be warning clean as well 😀

Thanks

  Andrea



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: scratch/igc warning
  2024-06-26 14:48   ` Andrea Corallo
@ 2024-06-26 14:57     ` Gerd Möllmann
  2024-06-26 16:25       ` scratch/igc lread testsuite error [was Re: scratch/igc warning] Andrea Corallo
  0 siblings, 1 reply; 12+ messages in thread
From: Gerd Möllmann @ 2024-06-26 14:57 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: emacs-devel

Andrea Corallo <acorallo@gnu.org> writes:

>> But I wonder - does GCC 12 also complain for the non-MPS case?
>
> It does not, my other tracked branches (master and emacs-30) are now
> warning clean here with similar configurations.

🤷



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: scratch/igc warning
  2024-06-26 14:43   ` Andrea Corallo
@ 2024-06-26 15:45     ` Pip Cet
  0 siblings, 0 replies; 12+ messages in thread
From: Pip Cet @ 2024-06-26 15:45 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: emacs-devel, Gerd Möllmann






On Wednesday, June 26th, 2024 at 14:43, Andrea Corallo <acorallo@gnu.org> wrote:

> > Something in between: the code is trying to clear a struct partially by memsetting starting from a given offset to the end of the struct. However, it's not specific to the igc branch.
> 
> 
> I believe it is, I don't see it in my other builds.

I meant the issue, if there is one, isn't specific to the igc branch. The GCC warning appears to be specific to allocation functions not declared with the attributes provided by ATTRIBUTE_MALLOC_SIZE ((1)). If I remove that attribute from xmalloc on the master branch and enable fortification, I see the warning there, as well.

Pip



^ permalink raw reply	[flat|nested] 12+ messages in thread

* scratch/igc lread testsuite error [was Re: scratch/igc warning]
  2024-06-26 14:57     ` Gerd Möllmann
@ 2024-06-26 16:25       ` Andrea Corallo
  2024-06-26 16:35         ` Gerd Möllmann
  2024-06-27  7:01         ` Helmut Eller
  0 siblings, 2 replies; 12+ messages in thread
From: Andrea Corallo @ 2024-06-26 16:25 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: emacs-devel

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> Andrea Corallo <acorallo@gnu.org> writes:
>
>>> But I wonder - does GCC 12 also complain for the non-MPS case?
>>
>> It does not, my other tracked branches (master and emacs-30) are now
>> warning clean here with similar configurations.
>
> 🤷

Cool is clean now!

Changing slightly subject:

I can bootstrap fine scratch/igc with nativecomp, and make check shows
here only one fail, 'lread-circle' in src/lread-tests.log.

This fails both with and without nativecomp, not sure this test fail was
already under your radar.

  Andrea



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: scratch/igc lread testsuite error [was Re: scratch/igc warning]
  2024-06-26 16:25       ` scratch/igc lread testsuite error [was Re: scratch/igc warning] Andrea Corallo
@ 2024-06-26 16:35         ` Gerd Möllmann
  2024-06-27  7:01         ` Helmut Eller
  1 sibling, 0 replies; 12+ messages in thread
From: Gerd Möllmann @ 2024-06-26 16:35 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: emacs-devel

Andrea Corallo <acorallo@gnu.org> writes:

> I can bootstrap fine scratch/igc with nativecomp, and make check shows
> here only one fail, 'lread-circle' in src/lread-tests.log.
>
> This fails both with and without nativecomp, not sure this test fail was
> already under your radar.

Thanks. No, I'm not working on the tests.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: scratch/igc lread testsuite error [was Re: scratch/igc warning]
  2024-06-26 16:25       ` scratch/igc lread testsuite error [was Re: scratch/igc warning] Andrea Corallo
  2024-06-26 16:35         ` Gerd Möllmann
@ 2024-06-27  7:01         ` Helmut Eller
  2024-06-27  7:09           ` Gerd Möllmann
  1 sibling, 1 reply; 12+ messages in thread
From: Helmut Eller @ 2024-06-27  7:01 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: Gerd Möllmann, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 205 bytes --]

On Wed, Jun 26 2024, Andrea Corallo wrote:

> I can bootstrap fine scratch/igc with nativecomp, and make check shows
> here only one fail, 'lread-circle' in src/lread-tests.log.

This should be fixed by:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Small-fixes-for-dumper.patch --]
[-- Type: text/x-diff, Size: 1436 bytes --]

From d68b4c832268ef2fe478ae9f77b3286406a4cdaa Mon Sep 17 00:00:00 2001
From: Helmut Eller <eller.helmut@gmail.com>
Date: Thu, 27 Jun 2024 08:38:56 +0200
Subject: [PATCH 1/2] Small fixes for dumper

* src/pdumper.c (dump_subr): Use dump_field_lv for command_modes.
(dump_igc_start_obj): DUMP_ALIGNMENT seems more appropriate than
igc_header_size.
---
 src/pdumper.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/pdumper.c b/src/pdumper.c
index 667f75ef6bf..4dfe38d0d8c 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -903,7 +903,7 @@ dump_igc_start_obj (struct dump_context *ctx, enum igc_obj_type type,
 {
   eassert (ctx->igc_type == IGC_OBJ_INVALID);
   eassert (ctx->igc_obj_dumped == NULL);
-  eassert (ctx->offset % igc_header_size () == 0);
+  eassert (ctx->offset % DUMP_ALIGNMENT == 0);
   ctx->igc_obj_dumped = (void *) in;
   ctx->igc_type = type;
   ctx->igc_base_offset = ctx->offset;
@@ -3033,7 +3033,8 @@ dump_subr (struct dump_context *ctx, const struct Lisp_Subr *subr)
     {
       dump_field_emacs_ptr (ctx, &out, subr, &subr->symbol_name);
       dump_field_emacs_ptr (ctx, &out, subr, &subr->intspec.string);
-      dump_field_emacs_ptr (ctx, &out, subr, &subr->command_modes);
+      eassert (NILP (subr->command_modes));
+      dump_field_lv (ctx, &out, subr, &subr->command_modes, WEIGHT_NORMAL);
     }
   DUMP_FIELD_COPY (&out, subr, doc);
 #ifdef HAVE_NATIVE_COMP
-- 
2.39.2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-Fix-lread-tests.patch --]
[-- Type: text/x-diff, Size: 1178 bytes --]

From 43d5bbe504f2ae86e206ced42bb7b2bbf104e29f Mon Sep 17 00:00:00 2001
From: Helmut Eller <eller.helmut@gmail.com>
Date: Thu, 27 Jun 2024 08:55:30 +0200
Subject: [PATCH 2/2] Fix lread-tests

* src/print.c (pp_stack_pop): Pop values from left to right.
---
 src/print.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/print.c b/src/print.c
index d2b4a586e6c..146cd7bd8c6 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1402,8 +1402,9 @@ pp_stack_push_values (Lisp_Object vectorlike, ptrdiff_t start, ptrdiff_t n)
     return;
   if (ppstack.sp >= ppstack.size)
     grow_pp_stack ();
-  ppstack.stack[ppstack.sp++]
-    = (struct print_pp_entry){ .start = start, .n = n, .u.vectorlike = vectorlike };
+  ppstack.stack[ppstack.sp++] = (struct print_pp_entry){
+    .start = start, .n = n, .u.vectorlike = vectorlike
+  };
   ppstack.stack[ppstack.sp - 1].is_free = false;
 }
 #else
@@ -1444,7 +1445,8 @@ pp_stack_pop (void)
   e->n--;
   Lisp_Object result;
 #ifdef HAVE_MPS
-  result = AREF (e->u.vectorlike, e->start + e->n);
+  result = AREF (e->u.vectorlike, e->start);
+  e->start++;
 #else
   result = (++e->u.values)[-1];
 #endif
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: scratch/igc lread testsuite error [was Re: scratch/igc warning]
  2024-06-27  7:01         ` Helmut Eller
@ 2024-06-27  7:09           ` Gerd Möllmann
  2024-06-27 12:09             ` Andrea Corallo
  0 siblings, 1 reply; 12+ messages in thread
From: Gerd Möllmann @ 2024-06-27  7:09 UTC (permalink / raw)
  To: Helmut Eller; +Cc: Andrea Corallo, emacs-devel

Helmut Eller <eller.helmut@gmail.com> writes:

> On Wed, Jun 26 2024, Andrea Corallo wrote:
>
>> I can bootstrap fine scratch/igc with nativecomp, and make check shows
>> here only one fail, 'lread-circle' in src/lread-tests.log.
>
> This should be fixed by:

Thanks, and pushed.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: scratch/igc lread testsuite error [was Re: scratch/igc warning]
  2024-06-27  7:09           ` Gerd Möllmann
@ 2024-06-27 12:09             ` Andrea Corallo
  0 siblings, 0 replies; 12+ messages in thread
From: Andrea Corallo @ 2024-06-27 12:09 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: Helmut Eller, emacs-devel

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> Helmut Eller <eller.helmut@gmail.com> writes:
>
>> On Wed, Jun 26 2024, Andrea Corallo wrote:
>>
>>> I can bootstrap fine scratch/igc with nativecomp, and make check shows
>>> here only one fail, 'lread-circle' in src/lread-tests.log.
>>
>> This should be fixed by:
>
> Thanks, and pushed.

Great, I confirm --with-mps --with-native-compilation=yes/no is now
clean on my test.  I'll keep tracking the branch.

  Andrea



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-06-27 12:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-26 14:08 scratch/igc warning Andrea Corallo
2024-06-26 14:31 ` Pip Cet
2024-06-26 14:43   ` Andrea Corallo
2024-06-26 15:45     ` Pip Cet
2024-06-26 14:39 ` Gerd Möllmann
2024-06-26 14:48   ` Andrea Corallo
2024-06-26 14:57     ` Gerd Möllmann
2024-06-26 16:25       ` scratch/igc lread testsuite error [was Re: scratch/igc warning] Andrea Corallo
2024-06-26 16:35         ` Gerd Möllmann
2024-06-27  7:01         ` Helmut Eller
2024-06-27  7:09           ` Gerd Möllmann
2024-06-27 12:09             ` Andrea Corallo

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).