public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: binutils@sourceware.org
Subject: Building with recent GCC versions: gdbsupport/gdb_assert.h:35:4: error: 'nonnull' argument 'filename' compared to NULL [-Werror=nonnull-compare]
Date: Sat, 17 Jul 2021 00:53:25 +0200	[thread overview]
Message-ID: <20210716225325.bb2ibcf6pf2ykanj@lug-owl.de> (raw)

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

Hi!

I noticed that when building GDB with a quite recent gcc (ie. "gcc
(Debian 20210630-1) 12.0.0 20210630" from Debian's gcc-snapshot
package), GDB will fail to build for all targets.

..../configure --target=aarch64-linux --prefix=/tmp/gdb-aarch64-linux
[...]
make all-gdb
[...]
  CXX    compile/compile-object-run.o
  CXX    compile/compile.o
In file included from ./../gdbsupport/common-defs.h:126,
                 from ./defs.h:28,
                 from compile/compile.c:20:
./../gdbsupport/gdb_unlinker.h: In constructor 'gdb::unlinker::unlinker(const char*)':
./../gdbsupport/gdb_assert.h:35:4: error: 'nonnull' argument 'filename' compared to NULL [-Werror=nonnull-compare]
   35 |   ((void) ((expr) ? 0 :                                                       \
      |   ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   36 |            (gdb_assert_fail (#expr, __FILE__, __LINE__, FUNCTION_NAME), 0)))
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./../gdbsupport/gdb_unlinker.h:38:5: note: in expansion of macro 'gdb_assert'
   38 |     gdb_assert (filename != NULL);
      |     ^~~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:1641: compile/compile.o] Error 1
make[1]: Leaving directory '/var/lib/laminar/run/gdb-aarch64-linux/3/binutils-gdb/gdb'
make: *** [Makefile:11410: all-gdb] Error 2


Thanks,
  Jan-Benedict

-- 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

             reply	other threads:[~2021-07-16 22:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-16 22:53 Jan-Benedict Glaw [this message]
2021-07-17  1:10 ` Alan Modra
2021-07-19 15:44   ` Jan-Benedict Glaw
2021-07-20 23:42     ` Alan Modra

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=20210716225325.bb2ibcf6pf2ykanj@lug-owl.de \
    --to=jbglaw@lug-owl.de \
    --cc=binutils@sourceware.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.
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).