[PATCH] D20561: Warn when taking address of packed member
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 1 08:26:50 PDT 2016
aaron.ballman added a comment.
In http://reviews.llvm.org/D20561#445730, @rogfer01 wrote:
> It came to my mind that might be good idea adding one of those "fix-it" suggestions so the user knows it can silence the warning by using parentheses. What do you think?
I don't think that would be appropriate here. We usually only use fix-it hints when we know the code is incorrect and the hint is the proper way to fix the problem. In this case, when we trigger the warning, we want users to fix the underlying problem of taking the address of something that will result in an unaligned pointer, but the fix-it you're thinking of will merely silence the warning without fixing the underlying problem.
http://reviews.llvm.org/D20561
More information about the cfe-commits
mailing list