summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2022-10-03 11:43:20 -0400
committerAllen Winter <allen.winter@kdab.com>2022-10-03 11:43:20 -0400
commit0fe0d9d4ef152243f47f9c8e17520d10a67ba2c6 (patch)
tree8a8b85e3090f5bc3a048fe7f9c261a6af9d61578 /src
parent8b681837b7345b720dd57e81bb3dbf726577422a (diff)
downloadlibical-git-0fe0d9d4ef152243f47f9c8e17520d10a67ba2c6.tar.gz
add clang diagnostic pragmas to quiet unreachable-code warnings
fixes: #486
Diffstat (limited to 'src')
-rw-r--r--src/libicalss/icalssyacc.c6
-rw-r--r--src/test/regression-storage.c3
2 files changed, 7 insertions, 2 deletions
diff --git a/src/libicalss/icalssyacc.c b/src/libicalss/icalssyacc.c
index 2416e528..e386ad80 100644
--- a/src/libicalss/icalssyacc.c
+++ b/src/libicalss/icalssyacc.c
@@ -1599,9 +1599,11 @@ yyerrorlab:
/* Pacify compilers like GCC when the user code never invokes
YYERROR and the label yyerrorlab therefore never appears in user
code. */
- if (/*CONSTCOND*/ 0)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunreachable-code"
+ if (/*CONSTCOND*/ 0)
goto yyerrorlab;
-
+#pragma clang diagnostic pop
/* Do not reclaim the symbols of the rule which action triggered
this YYERROR. */
YYPOPSTACK (yylen);
diff --git a/src/test/regression-storage.c b/src/test/regression-storage.c
index 7ce594d2..eb11f6d5 100644
--- a/src/test/regression-storage.c
+++ b/src/test/regression-storage.c
@@ -305,6 +305,8 @@ void test_bdbset()
return; // for now... TODO fix these broken tests..
+#pragma clang diagnostic push /* remove when/if we remove the proceeding return statement */
+#pragma clang diagnostic ignored "-Wunreachable-code"
start = icaltime_from_timet_with_zone(time(0), 0, NULL);
end = start;
end.hour++;
@@ -452,6 +454,7 @@ void test_bdbset()
}
icalset_free(cout);
}
+#pragma clang diagnostic pop
}
#endif