Skip to content

Commit 12f35b3

Browse files
committed
[tools] Use "#pragma GCC" instead of "#pragma clang" to ignore -Wcast-qual in c-index-test.c (NFC)
1 parent 4e83175 commit 12f35b3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

clang/tools/c-index-test/c-index-test.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,14 @@ void free_remapped_files(struct CXUnsavedFile *unsaved_files,
231231
int num_unsaved_files) {
232232
int i;
233233
for (i = 0; i != num_unsaved_files; ++i) {
234-
#if defined(__clang__)
235-
#pragma clang diagnostic push
236-
#pragma clang diagnostic ignored "-Wcast-qual"
234+
#ifdef __GNUC__
235+
#pragma GCC diagnostic push
236+
#pragma GCC diagnostic ignored "-Wcast-qual"
237237
#endif
238238
free((char *)unsaved_files[i].Filename);
239239
free((char *)unsaved_files[i].Contents);
240-
#if defined(__clang__)
241-
#pragma clang diagnostic pop
240+
#ifdef __GNUC__
241+
#pragma GCC diagnostic pop
242242
#endif
243243
}
244244
free(unsaved_files);
@@ -3766,13 +3766,13 @@ index_startedTranslationUnit(CXClientData client_data, void *reserved) {
37663766
printCheck(index_data);
37673767

37683768
printf("[startedTranslationUnit]\n");
3769-
#if defined(__clang__)
3770-
#pragma clang diagnostic push
3771-
#pragma clang diagnostic ignored "-Wcast-qual"
3769+
#ifdef __GNUC__
3770+
#pragma GCC diagnostic push
3771+
#pragma GCC diagnostic ignored "-Wcast-qual"
37723772
#endif
37733773
return (CXIdxClientContainer)"TU";
3774-
#if defined(__clang__)
3775-
#pragma clang diagnostic pop
3774+
#ifdef __GNUC__
3775+
#pragma GCC diagnostic pop
37763776
#endif
37773777
}
37783778

0 commit comments

Comments
 (0)