Implicit pointer conversions on ia64 are guaranteed to result in a segfault if the value is dereferenced. This issue can be easily identified by looking for a combination of gcc warnings. In fact, I have been running all of the build logs or the Debian distribution through a script that scans for this issue for several years, and it has caught hundreds of these problems: http://bugs.debian.org/cgi-bin/pkgreport.cgi?users=dannf@debian.org;which=tag&data=implicit-pointer-conversion&archive=no script here: http://people.debian.org/~dannf/check-implicit-pointer-functions I don't know anything about gcc internals, but I'm wondering if it is possible to generate an error when the appropriate combination of warning conditions is present?
-Werror=int-to-pointer-cast will make one class of warnings into errors, but I don't think there's a switch to handle the other cases your script detects.
There has been no update on this request in over 7 years. Is it still relevant (especially in light of comment #1)? If so, can you provide more details? I.e., what warnings specifically would you like to treat as errors that -Werror=warning-name doesn't let you do? Like so: $ cat t.c && /build/gcc-git/gcc/xgcc -B /build/gcc-git/gcc -O0 -S -Wall -Werror=int-conversion t.c int f (void*); void* g (void) { char *s = f (0); f (123); s = 345; return 456; } t.c: In function ‘g’: t.c:4:13: error: initialization makes pointer from integer without a cast [-Werror=int-conversion] char *s = f (0); ^ t.c:5:6: error: passing argument 1 of ‘f’ makes pointer from integer without a cast [-Werror=int-conversion] f (123); ^~~ t.c:1:5: note: expected ‘void *’ but argument is of type ‘int’ int f (void*); ^ t.c:6:5: error: assignment makes pointer from integer without a cast [-Werror=int-conversion] s = 345; ^ t.c:7:10: error: return makes pointer from integer without a cast [-Werror=int-conversion] return 456; ^~~ t.c:4:9: warning: variable ‘s’ set but not used [-Wunused-but-set-variable] char *s = f (0); ^ cc1: some warnings being treated as errors
Closing due to no feedback.