]> git.saurik.com Git - bison.git/commitdiff
aver: it is no longer "protected against NDEBUG"
authorAkim Demaille <akim@lrde.epita.fr>
Tue, 12 Nov 2013 14:46:27 +0000 (15:46 +0100)
committerAkim Demaille <akim@lrde.epita.fr>
Tue, 12 Nov 2013 14:49:10 +0000 (15:49 +0100)
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.

src/AnnotationList.c
src/muscle-tab.c

index b14c675b8f15f5dbabfecb76745022bab0617472..31d8a9911fa1b5a8ea3f0515b26cc56394a915aa 100644 (file)
@@ -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
index cc5d01dffa240293042346e4043ab923df65b370..71a79b4ea030bbf92c37e6c1d36e86c1e6ab4561 100644 (file)
@@ -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);