all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Corwin Brust <corwin@bru.st>
Cc: emacs-devel@gnu.org
Subject: Re: warnings in win32 builds from trunk
Date: Sun, 03 Apr 2022 09:17:29 +0300	[thread overview]
Message-ID: <831qye4rnq.fsf@gnu.org> (raw)
In-Reply-To: <CAJf-WoT9WYKEBfMpd2ikQETcX20WiNddZ8RjT8JGhFuTW=8exQ@mail.gmail.com> (message from Corwin Brust on Sat, 2 Apr 2022 18:33:27 -0500)

> From: Corwin Brust <corwin@bru.st>
> Date: Sat, 2 Apr 2022 18:33:27 -0500
> 
> Attempting to build a snapshot from the master branch today I noticed
> some warnings.  Here they are; please let me know if there's else I
> might helpfully do to troubleshoot/debug these (e.g. open a bug
> report).

Please file a bug report for each one of them.

> In file included from C:/Users/corwi/emacs-build/git/master/src/process.c:33:
> C:/Users/corwi/emacs-build/git/master/src/process.c: In function
> 'Fmake_process':
> C:/Users/corwi/emacs-build/git/master/src/lisp.h:1649:31: warning:
> null pointer dereference [-Wnull-dereference]
>  1649 |   return XSTRING (string)->u.s.data;
>       |          ~~~~~~~~~~~~~~~~~~~~~^~~~~

Line 1649 of lisp.h is inside SDATA.  But since Fmake_process doesn't
call SDATA directly, I don't know which string object is this about.
(Really, the compiler should do a better job when reporting such
issues, by showing all the relevant source locations.)

> C:/Users/corwi/emacs-build/git/master/src/w32menu.c: In function
> 'set_frame_menubar':
> C:/Users/corwi/emacs-build/git/master/src/w32menu.c:324:9: warning:
> 'memcpy' offset [3, 10] from the object at '<unknown>' is out of the
> bounds of referenced subobject 'contents' with type 'struct Lisp_X
> *[]' at offset 3 [-Warray-bounds]
>   324 |         memcpy (previous_items, XVECTOR (f->menu_bar_vector)->contents,
>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   325 |                 previous_menu_items_used * word_size);
>       |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from C:/Users/corwi/emacs-build/git/master/src/w32menu.c:26:
> C:/Users/corwi/emacs-build/git/master/src/lisp.h:1725:17: note:
> subobject 'contents' declared here
>  1725 |     Lisp_Object contents[FLEXIBLE_ARRAY_MEMBER];
>       |                 ^~~~~~~~

This is some general problem with FLEXIBLE_ARRAY_MEMBER, not specific
to w32.  Sounds like latest compilers don't like that.  Are you
building with custom compiler switches, per chance?

> C:/Users/corwi/emacs-build/git/master/src/w32heap.c: In function 'getrlimit':
> C:/Users/corwi/emacs-build/git/master/src/w32heap.c:853:14: warning:
> 'm' may be used uninitialized [-Wmaybe-uninitialized]
>   853 |         if (!VirtualQuery ((LPCVOID) &m, &m, sizeof m))
>       |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is a bogus warning, ignore it.  The compiler doesn't understand
the semantics of VirtualQuery.

Thanks.



  reply	other threads:[~2022-04-03  6:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-02 23:33 warnings in win32 builds from trunk Corwin Brust
2022-04-03  6:17 ` Eli Zaretskii [this message]
2022-04-03 16:30   ` Corwin Brust

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

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

  git send-email \
    --in-reply-to=831qye4rnq.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=corwin@bru.st \
    --cc=emacs-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.