gpgscm: Build well even if NDEBUG defined.
authorNIIBE Yutaka <gniibe@fsij.org>
Mon, 25 Feb 2019 01:44:16 +0000 (10:44 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Mon, 25 Feb 2019 01:44:16 +0000 (10:44 +0900)
* gpgscm/scheme.c (gc_reservation_failure): Fix adding ";".
[!NDEBUG] (scheme_init_custom_alloc): Don't init seserved_lineno.

--

Picked from libgpg-error commit of:
8a9397896fd202dcfb3fb46259e43bc05a0ddd2e

In some build environment, NDEBUG is defined (although it's
bad practice).  This change supports such a situation.

GnuPG-bug-id: 3959
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
tests/gpgscm/scheme.c

index feb3133..a819165 100644 (file)
@@ -872,7 +872,7 @@ gc_reservation_failure(struct scheme *sc)
 {
 #ifdef NDEBUG
   fprintf(stderr,
-         "insufficient reservation\n")
+         "insufficient reservation\n");
 #else
   fprintf(stderr,
          "insufficient %s reservation in line %d\n",
@@ -5614,7 +5614,9 @@ int scheme_init_custom_alloc(scheme *sc, func_alloc malloc, func_dealloc free) {
   sc->fcells = 0;
   sc->inhibit_gc = GC_ENABLED;
   sc->reserved_cells = 0;
+#ifndef NDEBUG
   sc->reserved_lineno = 0;
+#endif
   sc->no_memory=0;
   sc->inport=sc->NIL;
   sc->outport=sc->NIL;