unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>, Andrea Corallo <akrl@sdf.org>
Cc: larsi@gnus.org, emacs-devel@gnu.org
Subject: Re: ./configure --enable-check-lisp-object-type
Date: Tue, 12 Apr 2022 20:43:29 +0300	[thread overview]
Message-ID: <83o81642pq.fsf@gnu.org> (raw)
In-Reply-To: <jwvlewacj52.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Tue, 12 Apr 2022 13:23:21 -0400)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
> Date: Tue, 12 Apr 2022 13:23:21 -0400
> 
> > For the first time in a while I enabled the Lisp object type, and I was
> > given a wall of
> 
> I've been using it for many many years.
> 
> > dispnew.c:6593:1: note: in expansion of macro ‘DEFUN’
> >  6593 | DEFUN ("internal-show-cursor-p", Finternal_show_cursor_p,
> >       | ^~~~~
> > lisp.h:3179:5: warning: missing braces around initializer [-Wmissing-braces]
> >  3179 |     {{{{ PVEC_SUBR << PSEUDOVECTOR_AREA_BITS },                         \
> >       |     ^
> >
> > for every DEFUN.  That's new, isn't it?  (This is on Debian/bookworm.)
> 
> Yes, it's new enough that I haven't reported it yet.

The last change there was done 2 years ago, if my Git forensics are
correct.  So I wonder what exactly happened recently that started
triggering this.

> > #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc)	\
> >   SUBR_SECTION_ATTRIBUTE                                                \
> >   static union Aligned_Lisp_Subr sname =                                \
> >      {{{ PVEC_SUBR << PSEUDOVECTOR_AREA_BITS },				\
> >        { .a ## maxargs = fnname },					\
> >        minargs, maxargs, lname, {intspec}, 0}};				\
> >    Lisp_Object fnname
> >
> > That seems like beaucoup de braces, so is that a gcc bug or something?
> > (Adding more braces makes compilation fail.)
> 
> I don't know the syntax of C initializers well enough to judge, but
> I wasn't able to silence the warning by tweaking the code, so far.

I believe the problem is this:

  static union Aligned_Lisp_Subr sname =                                \
     {{{ PVEC_SUBR << PSEUDOVECTOR_AREA_BITS },				\
       { .a ## maxargs = fnname },					\
       minargs, maxargs, lname, {intspec}, 0}};				\
                                           ^

That zero corresponds to the 'Lisp_Object command_modes' member of
Aligned_Lisp_Subr, and in a build with --enable-check-lisp-object-type
a Lisp_Object is a struct, so it must be initialized with {0}, not
just a scalar zero.  This is what we had before April 2020, when
Andrea removed the braces around the zero in commit d73e6407.

Andrea, can you tell why this was done?  I don't think I understand
how the intent of that changeset justifies the removal.



  reply	other threads:[~2022-04-12 17:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12 16:58 ./configure --enable-check-lisp-object-type Lars Ingebrigtsen
2022-04-12 17:23 ` Stefan Monnier
2022-04-12 17:43   ` Eli Zaretskii [this message]
2022-04-12 18:27     ` Lars Ingebrigtsen
2022-04-12 18:34       ` Eli Zaretskii
2022-04-12 18:40         ` Lars Ingebrigtsen
2022-04-12 19:05           ` Eli Zaretskii
2022-04-12 22:20             ` Stefan Monnier
2022-04-13  8:47         ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83o81642pq.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=akrl@sdf.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).