lenary added a comment.

Two quick comments about when this is enabled, and then I'm happy!



================
Comment at: clang/lib/Driver/ToolChains/Arch/ARM.cpp:772-774
   if (KernelOrKext)
     Features.push_back("+strict-align");
   else if (Arg *A = Args.getLastArg(options::OPT_mno_unaligned_access,
----------------
I think we should be enabling this warning everywhere we enable `+strict-align` 
between lines 772 and 813, even though in some of those cases an explicit 
argument has not been provided to the compiler to enable or disable unaligned 
accesses.

This should probably also be the case for aarch64 too!


================
Comment at: clang/lib/Driver/ToolChains/Arch/ARM.cpp:784-787
     } else
       Features.push_back("+strict-align");
+    CmdArgs.push_back("-Wunaligned-access");
   } else {
----------------
I think you want the curly braces here, as the condition on 774 is looking for 
both `-munaligned-access` and `-mno-unaligned-access`, and then line 776 checks 
which direction the last argument actually went. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116221/new/

https://reviews.llvm.org/D116221

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to