C format issue with printf(“%d”, astatbuff->st_size); [duplicate]
问题 This question already has answers here : How should I print types like off_t and size_t? (9 answers) Closed 6 years ago . int lsdetails(struct stat *astatbuff) { printf("%d", astatbuff->st_size); printf("%d", astatbuff->st_atime); printf("%s\n", getpwuid(astatbuff->st_uid)->pw_name); return 0; } warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘__off_t’ [-Wformat] I received the above error message but I do not understand why. I am under the impression that I am