From: Florian Weimer <fweimer@redhat.com>
To: Alexandre Duret-Lutz <adl@lrde.epita.fr>
Cc: bug-gnulib@gnu.org
Subject: Re: clang++ 11 compilation issues
Date: Tue, 12 Jan 2021 19:23:54 +0100 [thread overview]
Message-ID: <87im82f1z9.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <87k0sixwya.fsf@lrde.epita.fr> (Alexandre Duret-Lutz's message of "Tue, 12 Jan 2021 11:37:33 +0100")
* Alexandre Duret-Lutz:
> (1) lib/argmatch.h includes lib/gettext.h which fails as follows
>
>> clang++ -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../buddy/src -I../lib -I../lib -W -Wall -Werror -Wint-to-void-pointer-cast -Wzero-as-null-pointer-constant -Wcast-align -Wpointer-arith -Wwrite-strings -Wcast-qual -DXTSTRINGDEFINES -Wdocumentation -Wmissing-declarations -Woverloaded-virtual -Wmisleading-indentation -Wimplicit-fallthrough -Wnull-dereference -Wsuggest-override -Wpedantic -fvisibility=hidden -fvisibility-inlines-hidden -DSPOT_BUILD -std=c++17 -g -O -MT autcross.o -MD -MP -MF .deps/autcross.Tpo -c -o autcross.o autcross.cc
>> In file included from autcross.cc:34:
>> In file included from ../lib/argmatch.h:31:
>> ../lib/gettext.h:234:22: error: zero as null pointer constant [-Werror,-Wzero-as-null-pointer-constant]
>> if (msg_ctxt_id != NULL)
>> ^~~~
>> nullptr
>> /usr/lib/llvm-11/lib/clang/11.0.1/include/stddef.h:84:18: note: expanded from macro 'NULL'
>> # define NULL __null
>> ^
Would you be able to check whether __null is in the preprocessed
sources? If it is there (and the lack of further logged expansions
suggests this), then this is a compiler bug. __null is not zero, and
should be fine to use as a null pointer constant. This is why NULL is
not defined as 0.
Thanks,
Florian
--
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill
next prev parent reply other threads:[~2021-01-12 18:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-12 10:37 clang++ 11 compilation issues Alexandre Duret-Lutz
2021-01-12 18:23 ` Florian Weimer [this message]
2021-01-13 11:31 ` Alexandre Duret-Lutz
2021-01-12 20:19 ` Bruno Haible
2021-01-13 21:04 ` Jeffrey Walton
2021-01-15 8:55 ` different CFLAGS for gnulib code? Bruno Haible
2021-01-15 9:20 ` Alexandre Duret-Lutz
2021-01-15 11:11 ` Paul Eggert
2021-01-15 16:36 ` Darshit Shah
2021-01-15 11:17 ` Simon Josefsson via Gnulib discussion list
2021-01-15 16:08 ` Jim Meyering
2021-01-17 12:55 ` Pádraig Brady
2021-01-14 0:37 ` clang++ 11 compilation issues Paul Eggert
2021-01-14 1:21 ` Bruno Haible
2021-01-14 1:55 ` Paul Eggert
2021-01-14 2:09 ` Bruno Haible
2021-01-14 18:21 ` Alexandre Duret-Lutz
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://lists.gnu.org/mailman/listinfo/bug-gnulib
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87im82f1z9.fsf@oldenburg2.str.redhat.com \
--to=fweimer@redhat.com \
--cc=adl@lrde.epita.fr \
--cc=bug-gnulib@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.
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).