summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkim Demaille <akim@lrde.epita.fr>2013-11-12 15:46:27 +0100
committerAkim Demaille <akim@lrde.epita.fr>2013-11-12 15:49:10 +0100
commit458171e6df5a0110a35ee45ad8b2e9f6fb426f1d (patch)
tree03c5f46e43a224da816c68c12d77589d8fdef4aa
parent8d0b7cef7df7fead44b9574cee342de336008625 (diff)
downloadbison-458171e6df5a0110a35ee45ad8b2e9f6fb426f1d.tar.gz
aver: it is no longer "protected against NDEBUG"
Apply the same rules for aver as for assert: no side effects, especially not important ones. * src/AnnotationList.c, src/muscle-tab.c: Adjust aver uses to resist to -DNDEBUG.
-rw-r--r--src/AnnotationList.c10
-rw-r--r--src/muscle-tab.c15
2 files changed, 15 insertions, 10 deletions
diff --git a/src/AnnotationList.c b/src/AnnotationList.c
index b14c675b..31d8a991 100644
--- a/src/AnnotationList.c
+++ b/src/AnnotationList.c
@@ -541,9 +541,13 @@ AnnotationList__compute_from_inadequacies (
{
InadequacyList__prependTo (conflict_node,
&inadequacy_lists[s->number]);
- aver (AnnotationList__insertInto (
- annotation_node, &annotation_lists[s->number],
- s->nitems));
+ {
+ bool b =
+ AnnotationList__insertInto (annotation_node,
+ &annotation_lists[s->number],
+ s->nitems);
+ aver (b);
+ }
/* This aver makes sure the
AnnotationList__computeDominantContribution check above
does discard annotations in the simplest case of a S/R
diff --git a/src/muscle-tab.c b/src/muscle-tab.c
index cc5d01df..71a79b4e 100644
--- a/src/muscle-tab.c
+++ b/src/muscle-tab.c
@@ -299,8 +299,9 @@ muscle_location_grow (char const *key, location loc)
#define COMMON_DECODE(Value) \
case '$': \
- aver (*++(Value) == ']'); \
- aver (*++(Value) == '['); \
+ ++(Value); aver (*(Value) == '['); \
+ ++(Value); aver (*(Value) == ']'); \
+ ++(Value); aver (*(Value) == '['); \
obstack_sgrow (&muscle_obstack, "$"); \
break; \
case '@': \
@@ -349,7 +350,7 @@ location_decode (char const *value)
location loc;
aver (value);
aver (*value == '[');
- aver (*++value == '[');
+ ++value; aver (*value == '[');
while (*++value)
switch (*value)
{
@@ -360,16 +361,16 @@ location_decode (char const *value)
case ']':
{
char *boundary_str;
- aver (*++value == ']');
+ ++value; aver (*value == ']');
boundary_str = obstack_finish0 (&muscle_obstack);
switch (*++value)
{
case ',':
boundary_set_from_string (&loc.start, boundary_str);
obstack_free (&muscle_obstack, boundary_str);
- aver (*++value == ' ');
- aver (*++value == '[');
- aver (*++value == '[');
+ ++value; aver (*value == ' ');
+ ++value; aver (*value == '[');
+ ++value; aver (*value == '[');
break;
case '\0':
boundary_set_from_string (&loc.end, boundary_str);