On Thu, Jun 12, 2014 at 11:40 AM, Stephan Bergmann <[email protected]> wrote:
> On 06/06/2014 11:39 PM, Richard Trieu wrote: > >> Author: rtrieu >> Date: Fri Jun 6 16:39:26 2014 >> New Revision: 210372 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=210372&view=rev >> Log: >> Add -Wtautological-undefined-compare and -Wundefined-bool-conversion >> warnings >> to detect underfined behavior involving pointers. >> > > Given that code that offends -Wtautological-undefined-compare (by > checking a reference for null) often also deliberately creates such null > references, a la > > int & r = *(int*)0; > > is there any fundamental reason to not also add a warning for such > constructs? Makes sense to me. We should warn for anything which the full power of the Clang-side constant folding can see a null pointer being bound to a reference, provided it isn't in dead code (which we already have a mechanism for).
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
