https://bugs.llvm.org/show_bug.cgi?id=36520
Bug ID: 36520
Summary: New diagnostic -Wzero-as-null-pointer-constant warns
on code in system headers.
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: luka...@chromium.org
CC: llvm-bugs@lists.llvm.org
This is a follow-up for https://bugs.llvm.org/show_bug.cgi?id=33771 - even
after this bug got fixed, some system headers result in warnings/errors:
In file included from ../../base/message_loop/message_pump_glib.cc:10:
In file included from
../../build/linux/debian_stretch_amd64-sysroot/usr/include/glib-2.0/glib.h:50:
In file included from
../../build/linux/debian_stretch_amd64-sysroot/usr/include/glib-2.0/glib/ghash.h:33:
In file included from
../../build/linux/debian_stretch_amd64-sysroot/usr/include/glib-2.0/glib/glist.h:32:
../../build/linux/debian_stretch_amd64-sysroot/usr/include/glib-2.0/glib/gmem.h:192:10:
error: zero as null pointer constant [-Werror,-Wzero-as-null-pointer-constant]
*ptr = NULL;
^~~~
nullptr
../../third_party/llvm-build/Release+Asserts/lib/clang/7.0.0/include/stddef.h:100:18:
note: expanded from macro 'NULL'
# define NULL __null
base/message_loop/message_pump_glib.cc looks like this (in particular, note
that |#include <foo.h>| rather than |#include "foo.h"| was used):
...
#include "base/message_loop/message_pump_glib.h"
#include <fcntl.h>
#include <math.h>
#include <glib.h> // <--- THIS PULLS IN SYSTEM HEADERS THAT RESULT IN THE
WARNING
#include "base/lazy_instance.h"
#include "base/logging.h"
...
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs