[compiler-rt] 000aeb2 - [hwasan] Fix build breakage (-Wunused-function) in hwasan_interceptors.cpp (NFC)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon May 22 17:09:42 PDT 2023


Could these functions be attributed `unused` to suppress the warning
instead? (so each use of this .inc file doesn't have to add the pragmas)

On Tue, May 16, 2023 at 10:01 PM Jie Fu via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

>
> Author: Jie Fu
> Date: 2023-05-17T13:00:50+08:00
> New Revision: 000aeb2499b1db510f064c37c097a5020215b835
>
> URL:
> https://github.com/llvm/llvm-project/commit/000aeb2499b1db510f064c37c097a5020215b835
> DIFF:
> https://github.com/llvm/llvm-project/commit/000aeb2499b1db510f064c37c097a5020215b835.diff
>
> LOG: [hwasan] Fix build breakage (-Wunused-function) in
> hwasan_interceptors.cpp (NFC)
>
> In file included from
> /data/llvm-project/compiler-rt/lib/hwasan/hwasan_interceptors.cpp:141:
> /data/llvm-project/compiler-rt/lib/hwasan/../sanitizer_common/sanitizer_common_interceptors.inc:1044:13:
> error: unused function 'write_iovec' [-Werror,-Wunused-function]
> static void write_iovec(void *ctx, struct __sanitizer_iovec *iovec,
>             ^
> /data/llvm-project/compiler-rt/lib/hwasan/../sanitizer_common/sanitizer_common_interceptors.inc:1053:13:
> error: unused function 'read_iovec' [-Werror,-Wunused-function]
> static void read_iovec(void *ctx, struct __sanitizer_iovec *iovec,
>             ^
> /data/llvm-project/compiler-rt/lib/hwasan/../sanitizer_common/sanitizer_common_interceptors.inc:10363:13:
> error: unused function 'InitializeCommonInterceptors'
> [-Werror,-Wunused-function]
> static void InitializeCommonInterceptors() {
>             ^
> 3 errors generated.
>
> Added:
>
>
> Modified:
>     compiler-rt/lib/hwasan/hwasan_interceptors.cpp
>
> Removed:
>
>
>
>
> ################################################################################
> diff  --git a/compiler-rt/lib/hwasan/hwasan_interceptors.cpp
> b/compiler-rt/lib/hwasan/hwasan_interceptors.cpp
> index f5099c2a835f..57df79d15123 100644
> --- a/compiler-rt/lib/hwasan/hwasan_interceptors.cpp
> +++ b/compiler-rt/lib/hwasan/hwasan_interceptors.cpp
> @@ -138,7 +138,10 @@ using namespace __hwasan;
>      (void)(name);                       \
>    } while (false)
>
> +#pragma clang diagnostic push
> +#pragma clang diagnostic ignored "-Wunused-function"
>  #include "sanitizer_common/sanitizer_common_interceptors.inc"
> +#pragma clang diagnostic pop
>
>  struct ThreadStartArg {
>    __sanitizer_sigset_t starting_sigset_;
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230522/5e3ac93e/attachment.html>


More information about the llvm-commits mailing list