gribozavr added a comment. What is the expected contract of the functions that this checker flags? Are they supposed to perform unaligned reads correctly, and we have just an implementation bug in these functions, or is it the caller's fault if they pass an unaligned address?
================ Comment at: clang-tidy/objc/ObjCTidyModule.cpp:30 "objc-avoid-nserror-init"); + CheckFactories.registerCheck<AvoidOSReadCheck>( + "objc-avoid-osread"); ---------------- Maybe a better place for this checker is the new "darwin" module? It is being added in https://reviews.llvm.org/D67567. ================ Comment at: test/clang-tidy/objc-avoid-osread.m:5 + const char *buff = ""; + OSReadBigInt(buff, 0); + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use memcpy and OSSwap{Big|Little}ToHostInt{16|32|64} instead of OSRead* calls to avoid potential unaligned read issues [objc-avoid-osread] ---------------- Please add declarations for these functions. It is strange that this test even works without them... CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67865/new/ https://reviews.llvm.org/D67865 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits