tests/gpgscm: Handle unhandled enumeration values.
authorJustus Winter <justus@g10code.com>
Thu, 7 Jan 2016 13:07:20 +0000 (14:07 +0100)
committerJustus Winter <justus@g10code.com>
Fri, 17 Jun 2016 09:38:00 +0000 (11:38 +0200)
* tests/gpgscm/scheme.c (opexe_{3,4}): Handle unhandled enumeration
values in the opcode dispatching code.

Signed-off-by: Justus Winter <justus@g10code.com>
tests/gpgscm/scheme.c

index 3d4330d..220eed3 100644 (file)
@@ -27,6 +27,7 @@
 # include <math.h>
 #endif
 
+#include <assert.h>
 #include <limits.h>
 #include <float.h>
 #include <ctype.h>
@@ -3654,6 +3655,7 @@ static pointer opexe_3(scheme *sc, enum scheme_opcodes op) {
                case OP_GRE:   comp_func=num_gt; break;
                case OP_LEQ:   comp_func=num_le; break;
                case OP_GEQ:   comp_func=num_ge; break;
+               default: assert (! "reached");
           }
           x=sc->args;
           v=nvalue(car(x));
@@ -3898,12 +3900,15 @@ static pointer opexe_4(scheme *sc, enum scheme_opcodes op) {
                case OP_OPEN_INFILE:     prop=port_input; break;
                case OP_OPEN_OUTFILE:    prop=port_output; break;
                case OP_OPEN_INOUTFILE: prop=port_input|port_output; break;
+               default: assert (! "reached");
           }
           p=port_from_filename(sc,strvalue(car(sc->args)),prop);
           if(p==sc->NIL) {
                s_return(sc,sc->F);
           }
           s_return(sc,p);
+         break;
+     default: assert (! "reached");
      }
 
 #if USE_STRING_PORTS
@@ -3914,6 +3919,7 @@ static pointer opexe_4(scheme *sc, enum scheme_opcodes op) {
           switch(op) {
                case OP_OPEN_INSTRING:     prop=port_input; break;
                case OP_OPEN_INOUTSTRING:  prop=port_input|port_output; break;
+               default: assert (! "reached");
           }
           p=port_from_string(sc, strvalue(car(sc->args)),
                  strvalue(car(sc->args))+strlength(car(sc->args)), prop);