[clang] 12f35b3 - [tools] Use "#pragma GCC" instead of "#pragma clang" to ignore -Wcast-qual in c-index-test.c (NFC)
Jie Fu via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 18 21:06:24 PDT 2023
Author: Jie Fu
Date: 2023-07-19T12:05:05+08:00
New Revision: 12f35b39ee63e932d4bdf6b28cce2e3d07713c4d
URL: https://github.com/llvm/llvm-project/commit/12f35b39ee63e932d4bdf6b28cce2e3d07713c4d
DIFF: https://github.com/llvm/llvm-project/commit/12f35b39ee63e932d4bdf6b28cce2e3d07713c4d.diff
LOG: [tools] Use "#pragma GCC" instead of "#pragma clang" to ignore -Wcast-qual in c-index-test.c (NFC)
Added:
Modified:
clang/tools/c-index-test/c-index-test.c
Removed:
################################################################################
diff --git a/clang/tools/c-index-test/c-index-test.c b/clang/tools/c-index-test/c-index-test.c
index 9c60e83f0bcf93..9d66a22f3b43b5 100644
--- a/clang/tools/c-index-test/c-index-test.c
+++ b/clang/tools/c-index-test/c-index-test.c
@@ -231,14 +231,14 @@ void free_remapped_files(struct CXUnsavedFile *unsaved_files,
int num_unsaved_files) {
int i;
for (i = 0; i != num_unsaved_files; ++i) {
-#if defined(__clang__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wcast-qual"
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wcast-qual"
#endif
free((char *)unsaved_files[i].Filename);
free((char *)unsaved_files[i].Contents);
-#if defined(__clang__)
-#pragma clang diagnostic pop
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
#endif
}
free(unsaved_files);
@@ -3766,13 +3766,13 @@ index_startedTranslationUnit(CXClientData client_data, void *reserved) {
printCheck(index_data);
printf("[startedTranslationUnit]\n");
-#if defined(__clang__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wcast-qual"
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wcast-qual"
#endif
return (CXIdxClientContainer)"TU";
-#if defined(__clang__)
-#pragma clang diagnostic pop
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
#endif
}
More information about the cfe-commits
mailing list