Add (void) when st is unused
This is to get rid of the GCC warning:
"warning: unused variable ‘st’ [-Wunused-variable]"
diff --git a/libasn1compiler/asn1c_constraint.c b/libasn1compiler/asn1c_constraint.c
index 0b502b6..df9ca68 100644
--- a/libasn1compiler/asn1c_constraint.c
+++ b/libasn1compiler/asn1c_constraint.c
@@ -195,6 +195,9 @@
OUT("1 /* No applicable constraints whatsoever */");
OUT(") {\n");
INDENT(-1);
+ if(produce_st) {
+ INDENTED(OUT("(void)st; /* Unused variable */\n"));
+ }
INDENTED(OUT("/* Nothing is here. See below */\n"));
OUT("}\n");
OUT("\n");
diff --git a/tests/125-bitstring-constraint-OK.asn1.-P b/tests/125-bitstring-constraint-OK.asn1.-P
index 6b5c762..c464138 100644
--- a/tests/125-bitstring-constraint-OK.asn1.-P
+++ b/tests/125-bitstring-constraint-OK.asn1.-P
@@ -42,6 +42,7 @@
if(1 /* No applicable constraints whatsoever */) {
+ (void)st; /* Unused variable */
/* Nothing is here. See below */
}
diff --git a/tests/90-cond-int-type-OK.asn1.-Pfwide-types b/tests/90-cond-int-type-OK.asn1.-Pfwide-types
index f170d99..30633fd 100644
--- a/tests/90-cond-int-type-OK.asn1.-Pfwide-types
+++ b/tests/90-cond-int-type-OK.asn1.-Pfwide-types
@@ -159,6 +159,7 @@
if(1 /* No applicable constraints whatsoever */) {
+ (void)st; /* Unused variable */
/* Nothing is here. See below */
}