Fix warning in sl compiler output

Use a cast through uintptr_t to un-const rather than a cast through
unsigned long.  This was caught by the Appeyor Windows build.
This commit is contained in:
Nicolas Williams
2018-12-28 11:37:16 -06:00
committed by Jeffrey Altman
parent 1dd38cc3de
commit a6e6916c1c

View File

@@ -398,7 +398,7 @@ static void defval_neg_flag(const char *name, struct assignment *defval)
static void defval_string(const char *name, struct assignment *defval) static void defval_string(const char *name, struct assignment *defval)
{ {
if(defval != NULL) if(defval != NULL)
cprint(1, "opt.%s = (char *)(unsigned long)\"%s\";\n", name, defval->u.value); cprint(1, "opt.%s = (char *)(uintptr_t)\"%s\";\n", name, defval->u.value);
else else
cprint(1, "opt.%s = NULL;\n", name); cprint(1, "opt.%s = NULL;\n", name);
} }
@@ -699,6 +699,7 @@ gen(struct assignment *as)
{ {
struct assignment *a; struct assignment *a;
cprint(0, "#include <stdio.h>\n"); cprint(0, "#include <stdio.h>\n");
cprint(0, "#include <stdint.h>\n");
cprint(0, "#include <getarg.h>\n"); cprint(0, "#include <getarg.h>\n");
cprint(0, "#include <sl.h>\n"); cprint(0, "#include <sl.h>\n");
cprint(0, "#include \"%s\"\n\n", hname); cprint(0, "#include \"%s\"\n\n", hname);