Fix "cast from pointer to integer of different size" warning

The way I saw this was that a non-unicode SBCL got a character decoding error
in RUN-PROGRAM on the C compiler whose output contained
  stack-alignment-offset.c: In function ‘stack_alignment_offset’:
where the quote mark is (CODE-CHAR #x2018) = #\LEFT_SINGLE_QUOTATION_MARK.

The SBCL error was only visible in the parallel test executor which seems to
run with LANG=en_US.UTF-8 instead of LANG=C. I don't know why the discrepancy.
But, hey, it was a good reason to get a locale setting wrong!
This commit is contained in:
Douglas Katzman 2020-05-14 12:44:54 -04:00
parent 3b8ea533b4
commit c0e1e6a711

View file

@ -22,7 +22,8 @@
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h> // for uintptr_t
#include <stdlib.h> // for atoi
/* <nikodemus> bwahahahaaa!
* <Xophe> oh dear. He's finally flipped
@ -35,7 +36,7 @@
extern int
stack_alignment_offset (int alignment)
{
return ((unsigned int)&alignment) % alignment;
return ((unsigned int)(uintptr_t)&alignment) % alignment;
}
extern int