From f197f0366f52d50e180222eb5419d07059f6d5ba Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Thu, 16 Nov 2017 10:25:14 -0500 Subject: [PATCH] Fix C warnings from sb-grovel on 32-bit macOS --- contrib/sb-grovel/def-to-lisp.lisp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/sb-grovel/def-to-lisp.lisp b/contrib/sb-grovel/def-to-lisp.lisp index 648aee7b4..ad424c188 100644 --- a/contrib/sb-grovel/def-to-lisp.lisp +++ b/contrib/sb-grovel/def-to-lisp.lisp @@ -119,7 +119,11 @@ code: (as-c "#define CAST_SIGNED(x) ((sizeof(x) == 4)? (long long) (long) (x): (x))") #+(and (not win32) x86-64) (as-c "#define CAST_SIGNED(x) ((sizeof(x) == 4)? (long) (int) (x): (x))") - #-x86-64 + ;; the C compiler on macOS warns that %ld is the wrong format for an int + ;; even though 'long' and 'int' are both 4 bytes. + #+x86 + (as-c "#define CAST_SIGNED(x) ((long) (x))") + #-(or x86 x86-64) (as-c "#define CAST_SIGNED(x) ((int) (x))") (as-c "int main(int argc, char *argv[]) {") (as-c " FILE *out;") -- 2.11.4.GIT