[compiler-rt] 0680ca7 - [InstrProf][NFC] Ignore -Wcast-qual after D153911 to fix build failure on AIX

Jake Egan via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 10:52:39 PDT 2023


Author: Jake Egan
Date: 2023-07-19T13:50:55-04:00
New Revision: 0680ca7f8c388bd929843badea04a4b4c3aa95e0

URL: https://github.com/llvm/llvm-project/commit/0680ca7f8c388bd929843badea04a4b4c3aa95e0
DIFF: https://github.com/llvm/llvm-project/commit/0680ca7f8c388bd929843badea04a4b4c3aa95e0.diff

LOG: [InstrProf][NFC] Ignore -Wcast-qual after D153911 to fix build failure on AIX

/scratch/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c:202:40: error: cast from 'const int (*)[0]' to 'void *' drops const qualifier [-Werror,-Wcast-qual]
                               (void *)&dummy_name, (void *)&dummy_vnds};
                                       ^
1 error generated.

Added: 
    

Modified: 
    compiler-rt/lib/profile/InstrProfilingPlatformAIX.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c b/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c
index 6e12fb9a044385..63219da18ae3a9 100644
--- a/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c
+++ b/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c
@@ -197,8 +197,14 @@ static int dummy_vnds[0] COMPILER_RT_SECTION(
 // To avoid GC'ing of the dummy variables by the linker, reference them in an
 // array and reference the array in the runtime registration code
 // (InstrProfilingRuntime.cpp)
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wcast-qual"
+#endif
 COMPILER_RT_VISIBILITY
 void *__llvm_profile_keep[] = {(void *)&dummy_cnts, (void *)&dummy_data,
                                (void *)&dummy_name, (void *)&dummy_vnds};
-
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
 #endif


        


More information about the llvm-commits mailing list