diff --git a/contrib/hstore/hstore_io.c b/contrib/hstore/hstore_io.c
index a9a55d8..db63ae9 100644
--- a/contrib/hstore/hstore_io.c
+++ b/contrib/hstore/hstore_io.c
@@ -1308,8 +1308,9 @@ hstore_to_json_loose(PG_FUNCTION_ARGS)
                                 * value
                                 */
                                char       *endptr = "junk";
+                               long ljunk = strtol(src->data, &endptr, 10);
 
-                               (void) strtol(src->data, &endptr, 10);
+                               (void) ljunk;
                                if (*endptr == '\0')
                                {
                                        /*
@@ -1321,7 +1322,9 @@ hstore_to_json_loose(PG_FUNCTION_ARGS)
                                else
                                {
                                        /* not an int - try a double */
-                                       (void) strtod(src->data, &endptr);
+                                       double djunk = strtod(src->data, &endptr);
+
+                                       (void) djunk;
                                        if (*endptr == '\0')
                                                is_number = true;
