Fixes for issues I've just found/introduced to x86 TCC.

- Cast from pointer to long long makes TCC output an error. Use cast to int before we apply shift operation for a pointer value.
- Removed test cases for casts from pointer to char/short because they produce warning.
This commit is contained in:
Shinichiro Hamaji
2009-04-16 02:34:59 +09:00
committed by grischka
parent be43c8e0ed
commit 83fd36333a
2 changed files with 6 additions and 3 deletions

View File

@ -1154,9 +1154,7 @@ void cast_test()
printf("sizeof(~(char)'a') = %d\n", sizeof(-(char)'a'));
/* from pointer to integer types */
printf("%d %d %d %d %d %d %ld %ld %lld %lld\n",
(char)p, (unsigned char)p,
(short)p, (unsigned short)p,
printf("%d %d %ld %ld %lld %lld\n",
(int)p, (unsigned int)p,
(long)p, (unsigned long)p,
(long long)p, (unsigned long long)p);