diff --git a/src/callback.c b/src/callback.c
index 1c6afe6..357a4b3 100644
--- a/src/callback.c
+++ b/src/callback.c
@@ -82,7 +82,7 @@ static int generate_native_callback(WORD_LIST *list)
     ffi_type *callbacktype;
     char **proto;
     char *resultname = "DLRETVAL";
-    char opt;
+    int opt;
     reset_internal_getopt();
 
     while ((opt = internal_getopt(list, "d:n:")) != -1) {
