public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Building with recent GCC versions: gdbsupport/gdb_assert.h:35:4: error: 'nonnull' argument 'filename' compared to NULL [-Werror=nonnull-compare]
@ 2021-07-16 22:53 Jan-Benedict Glaw
  2021-07-17  1:10 ` Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: Jan-Benedict Glaw @ 2021-07-16 22:53 UTC (permalink / raw)
  To: binutils

[-- 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 --]

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

end of thread, other threads:[~2021-07-20 23:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-16 22:53 Building with recent GCC versions: gdbsupport/gdb_assert.h:35:4: error: 'nonnull' argument 'filename' compared to NULL [-Werror=nonnull-compare] Jan-Benedict Glaw
2021-07-17  1:10 ` Alan Modra
2021-07-19 15:44   ` Jan-Benedict Glaw
2021-07-20 23:42     ` Alan Modra

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).