|
From: Julian S. <js...@ac...> - 2010-06-14 00:23:33
|
On Sunday, June 13, 2010, Bart Van Assche wrote: > It took some time before I noticed, but the patch below triggers the > following warnings during compilation on PPC (make check): > > [ ... ] > g++ -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../include -I../../coregrind > -I../ ../include -I../../VEX/pub -DVGA_ppc64=1 -DVGO_linux=1 > -DVGP_ppc64_linux=1 -Win line -Wall -Wshadow -g -m64 -g -O2 -MT > valgrind_cpp_test.o -MD -MP -MF .deps/val grind_cpp_test.Tpo -c -o > valgrind_cpp_test.o valgrind_cpp_test.cpp In file included from > ../../include/pub_tool_vki.h:49, > from valgrind_cpp_test.cpp:14: > ../../include/vki/vki-linux.h:2159: warning: division by zero > ../../include/vki/vki-linux.h:2162: warning: division by zero > [ ... ] (btw, I'm sure Konstantin S et al grappled with this at some time in the past.) > Would it be OK to rewrite the _VKI_IOC_TYPECHECK() macro and to base > it on something similar to BUILD_BUG_ON() as present in the Linux > kernel ? Sounds good. This is the old trick where for doing compile time assertions, in resulting in declaration of an array of size -1 if the assertion fails, yes? Only comment is that BUILD_BUG_ON is a terrible name (what does it mean?) I'd prefer STATIC_ASSERT or something similar. J |