Subject: | null-dereference warning |
Date: | Tue, 20 May 2014 10:40:18 -0400 |
To: | bug-Function-Parameters [...] rt.cpan.org |
From: | "Daniel Macks" <dmacks [...] netspace.org> |
Building Function-Parameters-1.0401 on OS X 10.8 with perl-5.16.2 (via fink) and no other CPAN modules installed:
gcc -c -I/sw/include -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O3 -DVERSION=\"1.0401\" -DXS_VERSION=\"1.0401\" "-I/sw/lib/perl5-core/5.16.2/darwin-thread-multi-2level/CORE" Parameters.c
In file included from Parameters.xs:221:
./padop_on_crack.c.inc:375:5: warning: indirection of non-volatile null pointer
will be deleted, not trap [-Wnull-dereference]
*((int *)NULL) += 1;
^~~~~~~~~~~~~~
./padop_on_crack.c.inc:375:5: note: consider using __builtin_trap() or
qualifying pointer with 'volatile'
1 warning generated.
My gcc is from Apple's XCode-5.1.1 suite:
gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
dan
--
Daniel Macks
dmacks@netspace.org