Getting rid of some more compiler warnings

This commit is contained in:
Dan Buch 2012-02-11 14:39:50 -05:00
parent 8ad2b3d4ca
commit 898c6e4be1

108
ex21.c
View File

@ -4,121 +4,121 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
printf("sizeof(int8_t) = %d\n", sizeof(int8_t)); printf("sizeof(int8_t) = %ld\n", sizeof(int8_t));
printf("sizeof(uint8_t) = %d\n", sizeof(uint8_t)); printf("sizeof(uint8_t) = %ld\n", sizeof(uint8_t));
printf("sizeof(int16_t) = %d\n", sizeof(int16_t)); printf("sizeof(int16_t) = %ld\n", sizeof(int16_t));
printf("sizeof(uint16_t) = %d\n", sizeof(uint16_t)); printf("sizeof(uint16_t) = %ld\n", sizeof(uint16_t));
printf("sizeof(int32_t) = %d\n", sizeof(int32_t)); printf("sizeof(int32_t) = %ld\n", sizeof(int32_t));
printf("sizeof(uint32_t) = %d\n", sizeof(uint32_t)); printf("sizeof(uint32_t) = %ld\n", sizeof(uint32_t));
#if defined(_M_X64) || defined(__amd64__) #if defined(_M_X64) || defined(__amd64__)
printf("sizeof(int64_t) = %d\n", sizeof(int64_t)); printf("sizeof(int64_t) = %ld\n", sizeof(int64_t));
printf("sizeof(uint64_t) = %d\n", sizeof(uint64_t)); printf("sizeof(uint64_t) = %ld\n", sizeof(uint64_t));
#endif #endif
printf("INT8_MAX = %d\n", INT8_MAX); printf("INT8_MAX = %d\n", INT8_MAX);
printf("INT16_MAX = %d\n", INT16_MAX); printf("INT16_MAX = %d\n", INT16_MAX);
printf("INT32_MAX = %d\n", INT32_MAX); printf("INT32_MAX = %d\n", INT32_MAX);
#if defined(_M_X64) || defined(__amd64__) #if defined(_M_X64) || defined(__amd64__)
printf("INT64_MAX = %d\n", INT64_MAX); printf("INT64_MAX = %ld\n", INT64_MAX);
#endif #endif
printf("INT8_MIN = %d\n", INT8_MIN); printf("INT8_MIN = %d\n", INT8_MIN);
printf("INT16_MIN = %d\n", INT16_MIN); printf("INT16_MIN = %d\n", INT16_MIN);
printf("INT32_MIN = %d\n", INT32_MIN); printf("INT32_MIN = %d\n", INT32_MIN);
#if defined(_M_X64) || defined(__amd64__) #if defined(_M_X64) || defined(__amd64__)
printf("INT64_MIN = %d\n", INT64_MIN); printf("INT64_MIN = %ld\n", INT64_MIN);
#endif #endif
printf("sizeof(int_least8_t) = %d\n", sizeof(int_least8_t)); printf("sizeof(int_least8_t) = %ld\n", sizeof(int_least8_t));
printf("sizeof(int_least16_t) = %d\n", sizeof(int_least16_t)); printf("sizeof(int_least16_t) = %ld\n", sizeof(int_least16_t));
printf("sizeof(int_least32_t) = %d\n", sizeof(int_least32_t)); printf("sizeof(int_least32_t) = %ld\n", sizeof(int_least32_t));
#if defined(_M_X64) || defined(__amd64__) #if defined(_M_X64) || defined(__amd64__)
printf("sizeof(int_least64_t) = %d\n", sizeof(int_least64_t)); printf("sizeof(int_least64_t) = %ld\n", sizeof(int_least64_t));
#endif #endif
printf("sizeof(uint_least8_t) = %d\n", sizeof(uint_least8_t)); printf("sizeof(uint_least8_t) = %ld\n", sizeof(uint_least8_t));
printf("sizeof(uint_least16_t) = %d\n", sizeof(uint_least16_t)); printf("sizeof(uint_least16_t) = %ld\n", sizeof(uint_least16_t));
printf("sizeof(uint_least32_t) = %d\n", sizeof(uint_least32_t)); printf("sizeof(uint_least32_t) = %ld\n", sizeof(uint_least32_t));
#if defined(_M_X64) || defined(__amd64__) #if defined(_M_X64) || defined(__amd64__)
printf("sizeof(uint_least64_t) = %d\n", sizeof(uint_least64_t)); printf("sizeof(uint_least64_t) = %ld\n", sizeof(uint_least64_t));
#endif #endif
printf("INT_LEAST8_MAX = %d\n", INT_LEAST8_MAX); printf("INT_LEAST8_MAX = %d\n", INT_LEAST8_MAX);
printf("INT_LEAST16_MAX = %d\n", INT_LEAST16_MAX); printf("INT_LEAST16_MAX = %d\n", INT_LEAST16_MAX);
printf("INT_LEAST32_MAX = %d\n", INT_LEAST32_MAX); printf("INT_LEAST32_MAX = %d\n", INT_LEAST32_MAX);
#if defined(_M_X64) || defined(__amd64__) #if defined(_M_X64) || defined(__amd64__)
printf("INT_LEAST64_MAX = %d\n", INT_LEAST64_MAX); printf("INT_LEAST64_MAX = %ld\n", INT_LEAST64_MAX);
#endif #endif
printf("INT_LEAST8_MIN = %d\n", INT_LEAST8_MIN); printf("INT_LEAST8_MIN = %d\n", INT_LEAST8_MIN);
printf("INT_LEAST16_MIN = %d\n", INT_LEAST16_MIN); printf("INT_LEAST16_MIN = %d\n", INT_LEAST16_MIN);
printf("INT_LEAST32_MIN = %d\n", INT_LEAST32_MIN); printf("INT_LEAST32_MIN = %d\n", INT_LEAST32_MIN);
#if defined(_M_X64) || defined(__amd64__) #if defined(_M_X64) || defined(__amd64__)
printf("INT_LEAST64_MIN = %d\n", INT_LEAST64_MIN); printf("INT_LEAST64_MIN = %ld\n", INT_LEAST64_MIN);
#endif #endif
printf("UINT_LEAST8_MAX = %d\n", UINT_LEAST8_MAX); printf("UINT_LEAST8_MAX = %d\n", UINT_LEAST8_MAX);
printf("UINT_LEAST16_MAX = %d\n", UINT_LEAST16_MAX); printf("UINT_LEAST16_MAX = %d\n", UINT_LEAST16_MAX);
printf("UINT_LEAST32_MAX = %d\n", UINT_LEAST32_MAX); printf("UINT_LEAST32_MAX = %d\n", UINT_LEAST32_MAX);
#if defined(_M_X64) || defined(__amd64__) #if defined(_M_X64) || defined(__amd64__)
printf("UINT_LEAST64_MAX = %d\n", UINT_LEAST64_MAX); printf("UINT_LEAST64_MAX = %ld\n", UINT_LEAST64_MAX);
#endif #endif
printf("sizeof(int_fast8_t) = %d\n", sizeof(int_fast8_t)); printf("sizeof(int_fast8_t) = %ld\n", sizeof(int_fast8_t));
printf("sizeof(int_fast16_t) = %d\n", sizeof(int_fast16_t)); printf("sizeof(int_fast16_t) = %ld\n", sizeof(int_fast16_t));
printf("sizeof(int_fast32_t) = %d\n", sizeof(int_fast32_t)); printf("sizeof(int_fast32_t) = %ld\n", sizeof(int_fast32_t));
#if defined(_M_X64) || defined(__amd64__) #if defined(_M_X64) || defined(__amd64__)
printf("sizeof(int_fast64_t) = %d\n", sizeof(int_fast64_t)); printf("sizeof(int_fast64_t) = %ld\n", sizeof(int_fast64_t));
#endif #endif
printf("sizeof(uint_fast8_t) = %d\n", sizeof(uint_fast8_t)); printf("sizeof(uint_fast8_t) = %ld\n", sizeof(uint_fast8_t));
printf("sizeof(uint_fast16_t) = %d\n", sizeof(uint_fast16_t)); printf("sizeof(uint_fast16_t) = %ld\n", sizeof(uint_fast16_t));
printf("sizeof(uint_fast32_t) = %d\n", sizeof(uint_fast32_t)); printf("sizeof(uint_fast32_t) = %ld\n", sizeof(uint_fast32_t));
#if defined(_M_X64) || defined(__amd64__) #if defined(_M_X64) || defined(__amd64__)
printf("sizeof(uint_fast64_t) = %d\n", sizeof(uint_fast64_t)); printf("sizeof(uint_fast64_t) = %ld\n", sizeof(uint_fast64_t));
#endif #endif
printf("INT_FAST8_MAX = %d\n", INT_FAST8_MAX); printf("INT_FAST8_MAX = %d\n", INT_FAST8_MAX);
printf("INT_FAST16_MAX = %d\n", INT_FAST16_MAX); printf("INT_FAST16_MAX = %ld\n", INT_FAST16_MAX);
printf("INT_FAST32_MAX = %d\n", INT_FAST32_MAX); printf("INT_FAST32_MAX = %ld\n", INT_FAST32_MAX);
#if defined(_M_X64) || defined(__amd64__) #if defined(_M_X64) || defined(__amd64__)
printf("INT_FAST64_MAX = %d\n", INT_FAST64_MAX); printf("INT_FAST64_MAX = %ld\n", INT_FAST64_MAX);
#endif #endif
printf("INT_FAST8_MAX = %d\n", INT_FAST8_MAX); printf("INT_FAST8_MAX = %d\n", INT_FAST8_MAX);
printf("INT_FAST16_MAX = %d\n", INT_FAST16_MAX); printf("INT_FAST16_MAX = %ld\n", INT_FAST16_MAX);
printf("INT_FAST32_MAX = %d\n", INT_FAST32_MAX); printf("INT_FAST32_MAX = %ld\n", INT_FAST32_MAX);
#if defined(_M_X64) || defined(__amd64__) #if defined(_M_X64) || defined(__amd64__)
printf("INT_FAST64_MAX = %d\n", INT_FAST64_MAX); printf("INT_FAST64_MAX = %ld\n", INT_FAST64_MAX);
#endif #endif
printf("INT_FAST8_MIN = %d\n", INT_FAST8_MIN); printf("INT_FAST8_MIN = %d\n", INT_FAST8_MIN);
printf("INT_FAST16_MIN = %d\n", INT_FAST16_MIN); printf("INT_FAST16_MIN = %ld\n", INT_FAST16_MIN);
printf("INT_FAST32_MIN = %d\n", INT_FAST32_MIN); printf("INT_FAST32_MIN = %ld\n", INT_FAST32_MIN);
#if defined(_M_X64) || defined(__amd64__) #if defined(_M_X64) || defined(__amd64__)
printf("INT_FAST64_MIN = %d\n", INT_FAST64_MIN); printf("INT_FAST64_MIN = %ld\n", INT_FAST64_MIN);
#endif #endif
printf("UINT_FAST8_MAX = %d\n", UINT_FAST8_MAX); printf("UINT_FAST8_MAX = %d\n", UINT_FAST8_MAX);
printf("UINT_FAST16_MAX = %d\n", UINT_FAST16_MAX); printf("UINT_FAST16_MAX = %ld\n", UINT_FAST16_MAX);
printf("UINT_FAST32_MAX = %d\n", UINT_FAST32_MAX); printf("UINT_FAST32_MAX = %ld\n", UINT_FAST32_MAX);
#if defined(_M_X64) || defined(__amd64__) #if defined(_M_X64) || defined(__amd64__)
printf("UINT_FAST64_MAX = %d\n", UINT_FAST64_MAX); printf("UINT_FAST64_MAX = %ld\n", UINT_FAST64_MAX);
#endif #endif
printf("sizeof(intptr_t) = %d\n", sizeof(intptr_t)); printf("sizeof(intptr_t) = %ld\n", sizeof(intptr_t));
printf("sizeof(uintptr_t) = %d\n", sizeof(uintptr_t)); printf("sizeof(uintptr_t) = %ld\n", sizeof(uintptr_t));
printf("INTPTR_MAX = %d\n", INTPTR_MAX); printf("INTPTR_MAX = %ld\n", INTPTR_MAX);
printf("INTPTR_MIN = %d\n", INTPTR_MIN); printf("INTPTR_MIN = %ld\n", INTPTR_MIN);
printf("UINTPTR_MAX = %d\n", UINTPTR_MAX); printf("UINTPTR_MAX = %ld\n", UINTPTR_MAX);
printf("sizeof(intmax_t) = %d\n", sizeof(intmax_t)); printf("sizeof(intmax_t) = %ld\n", sizeof(intmax_t));
printf("sizeof(uintmax_t) = %d\n", sizeof(uintmax_t)); printf("sizeof(uintmax_t) = %ld\n", sizeof(uintmax_t));
printf("INTMAX_MAX = %lld\n", INTMAX_MAX); printf("INTMAX_MAX = %ld\n", INTMAX_MAX);
printf("INTMAX_MIN = %lld\n", INTMAX_MIN); printf("INTMAX_MIN = %ld\n", INTMAX_MIN);
printf("UINTMAX_MAX = %lld\n", UINTMAX_MAX); printf("UINTMAX_MAX = %ld\n", UINTMAX_MAX);
printf("PTRDIFF_MIN = %d\n", PTRDIFF_MIN); printf("PTRDIFF_MIN = %ld\n", PTRDIFF_MIN);
printf("PTRDIFF_MAX = %d\n", PTRDIFF_MAX); printf("PTRDIFF_MAX = %ld\n", PTRDIFF_MAX);
printf("SIZE_MAX = %d\n", SIZE_MAX); printf("SIZE_MAX = %ld\n", SIZE_MAX);
return 0; return 0;
} }