summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--opkg-opk/opk/read.c47
1 files changed, 33 insertions, 14 deletions
diff --git a/opkg-opk/opk/read.c b/opkg-opk/opk/read.c
index ba86c93..7f5b3dd 100644
--- a/opkg-opk/opk/read.c
+++ b/opkg-opk/opk/read.c
@@ -155,8 +155,10 @@ _opkg_opk_opk_read_control(struct opkg_opk_opk *opk)
if (_opkg_opk_opk_read_init_inner(opk) != OPKG_OPK_OK) {
if (opk->control_dir != NULL) {
# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored \
- "-Wanalyzer-use-of-uninitialized-value"
+# if __GNUC__ >= 11
+# pragma GCC diagnostic ignored \
+ "-Wanalyzer-use-of-uninitialized-value"
+# endif
free(path);
# pragma GCC diagnostic pop
}
@@ -183,8 +185,10 @@ _opkg_opk_opk_read_control(struct opkg_opk_opk *opk)
_opkg_opk_opk_read_free_inner(opk);
if (opk->control_dir != NULL) {
# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored \
+# if __GNUC__ >= 11
+# pragma GCC diagnostic ignored \
"-Wanalyzer-use-of-uninitialized-value"
+# endif
free(path);
# pragma GCC diagnostic pop
}
@@ -194,8 +198,10 @@ _opkg_opk_opk_read_control(struct opkg_opk_opk *opk)
/* Open file for extraction. */
if (opk->control_dir != NULL) {
# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored \
- "-Wanalyzer-use-of-uninitialized-value"
+# if __GNUC__ >= 11
+# pragma GCC diagnostic ignored \
+ "-Wanalyzer-use-of-uninitialized-value"
+# endif
if (sprintf(path, "%s/%s", opk->control_dir,
member->name) <= 0) {
opkg_opk_ustar_member_free(member);
@@ -218,8 +224,10 @@ _opkg_opk_opk_read_control(struct opkg_opk_opk *opk)
opkg_opk_ustar_member_free(member);
_opkg_opk_opk_read_free_inner(opk);
# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored \
+# if __GNUC__ >= 11
+# pragma GCC diagnostic ignored \
"-Wanalyzer-use-of-uninitialized-value"
+# endif
free(path);
# pragma GCC diagnostic pop
return OPKG_OPK_ERROR;
@@ -261,8 +269,10 @@ _opkg_opk_opk_read_control(struct opkg_opk_opk *opk)
return OPKG_OPK_ERROR;
}
# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored \
- "-Wanalyzer-use-of-uninitialized-value"
+# if __GNUC__ >= 11
+# pragma GCC diagnostic ignored \
+ "-Wanalyzer-use-of-uninitialized-value"
+# endif
if (opk->control_dir != NULL && fwrite(buffer, 1, size,
fp) != size) {
opkg_opk_error(_("Failed to write control file")
@@ -278,8 +288,10 @@ _opkg_opk_opk_read_control(struct opkg_opk_opk *opk)
_opkg_opk_opk_read_free_inner(opk);
if (opk->control_dir != NULL) {
# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored \
+# if __GNUC__ >= 11
+# pragma GCC diagnostic ignored \
"-Wanalyzer-use-of-uninitialized-value"
+# endif
# pragma GCC diagnostic ignored \
"-Wmaybe-uninitialized"
free(path);
@@ -287,7 +299,10 @@ _opkg_opk_opk_read_control(struct opkg_opk_opk *opk)
# pragma GCC diagnostic pop
}
# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wanalyzer-file-leak"
+# if __GNUC__ >= 10
+# pragma GCC diagnostic ignored \
+ "-Wanalyzer-file-leak"
+# endif
return OPKG_OPK_ERROR;
# pragma GCC diagnostic pop
}
@@ -296,8 +311,10 @@ _opkg_opk_opk_read_control(struct opkg_opk_opk *opk)
/* Close file for extraction. */
if (opk->control_dir != NULL) {
# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored \
- "-Wanalyzer-use-of-uninitialized-value"
+# if __GNUC__ >= 11
+# pragma GCC diagnostic ignored \
+ "-Wanalyzer-use-of-uninitialized-value"
+# endif
if (fclose(fp) != 0) {
_opkg_opk_opk_read_free_inner(opk);
free(path);
@@ -309,8 +326,10 @@ _opkg_opk_opk_read_control(struct opkg_opk_opk *opk)
if (opk->control_dir != NULL) {
/* Done with path buffer. */
# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored \
- "-Wanalyzer-use-of-uninitialized-value"
+# if __GNUC__ >= 11
+# pragma GCC diagnostic ignored \
+ "-Wanalyzer-use-of-uninitialized-value"
+# endif
# pragma GCC diagnostic ignored \
"-Wmaybe-uninitialized"
free(path);