------- Additional Comments From salinger at sun dot felk dot cvut dot cz  
2004-12-08 17:07 -------
Thanks for explanation. 

The warning message was confusing for me.
Could be possible to distinguish between NULL without pointer conversion
and completely forgotten NULL ?

With something like this:

--- gcc/c-common.c.std  Wed Dec  8 16:14:12 2004
+++ gcc/c-common.c      Wed Dec  8 17:45:03 2004
@@ -5041,7 +5041,12 @@
          /* Validate the sentinel.  */
          if (!POINTER_TYPE_P (TREE_TYPE (TREE_VALUE (sentinel)))
              || !integer_zerop (TREE_VALUE (sentinel)))
-           warning ("missing sentinel in function call");
+           {
+             if (!integer_zerop (TREE_VALUE (sentinel)))
+               warning ("missing sentinel in function call");
+             else  
+               warning ("wrong sentinel in function call - NULL should be cast
to appropriate pointer type");
+           }
        }
     }
 }

 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|RESOLVED                    |UNCONFIRMED
           Keywords|                            |diagnostic
         Resolution|INVALID                     |
            Summary|attribute sentinel doesn't  |misleading warning from
                   |work with C++               |attribute sentinel in C++


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18886

Reply via email to