Warning for different pointer signedness

Mike Stump mrs@apple.com
Tue Dec 21 00:46:00 GMT 2004


On Dec 20, 2004, at 2:51 PM, Andrew Pinski wrote:
> Maybe the correct fix was to document it but that is what the JSM
> wanted and nobody yelled when Mike proposed this in the first
> place.
Since the impact of the recent change to always warn for this invalid 
code seems larger than what people were expecting, do we want to 
consider adding a flag to add the extension or to otherwise inhibit the 
warning? If yes, what should it be called -fsigned-conversions or 
-Wsigned-conversions?

I'm thinking of something like:

*** ./c-typeck.c.~1~ Fri Jul 23 16:16:25 2004
--- ./c-typeck.c Fri Jul 23 16:18:02 2004
*************** convert_for_assignment (tree type, tree
*** 3472,3478 ****
  || target_cmp)
  ;
  /* If there is a mismatch, do warn. */
! else
  warn_for_assignment ("pointer targets in %s differ in signedness",
  errtype, funname, parmnum);
  }
--- 3472,3478 ----
  || target_cmp)
  ;
  /* If there is a mismatch, do warn. */
! else if (!flag_signed_conversions)
  warn_for_assignment ("pointer targets in %s differ in signedness",
  errtype, funname, parmnum);
  }


What do others think? This type of change exactly restores the 
extension as it existed before we started changing this area of the 
compiler.



More information about the Gcc mailing list