@asuffield said:
You can write code that works now by casting to long long, but at some point in the future, when C introduces new larger types and some POSIX implementers make their types larger, your code will break.
Currently we have code that's broken because it cast time_t to long, which was correct until about six years ago. The next one we're likely to run into is off_t, when it increases from 64-bit to 128-bit - that should happen in the next ten years, given the current rate of increase in the size of hard drives.
You can write code that works now and that will still work in the future by casting to intmax_t and using the j length modifier.