On 2022-08-05 09:22:42 +0200, Karl Yerkes wrote:
> That did not help. It seems that there is a problem on ARM or Apple
> Silicon, specifically:
> 
> #include <stdio.h>
> int main() {
>   printf("%%lu: %lu\n", sizeof("this is a string"));
>   printf("%%d: %d\n", sizeof("this is a string"));
>   printf("%%zu: %zu\n", sizeof("this is a string"));
> }

In any case, this code has undefined behavior. Just use %zu,
nothing else.

That said, if size_t has the same size as unsigned long, the first
line should have probably been correct in practice, and

> $ tcc tcc-string-literal-sizeof.c
> FIXME: handle reloc type 9 at 1052 [0x60000155c032] to 1050

may be an issue with tcc (though this is conform to the standard).

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to