Skip to content

Instantly share code, notes, and snippets.

@robertkarl
Created April 2, 2017 09:20
Show Gist options
  • Select an option

  • Save robertkarl/05491a3a9c731cac3bd198114673dad6 to your computer and use it in GitHub Desktop.

Select an option

Save robertkarl/05491a3a9c731cac3bd198114673dad6 to your computer and use it in GitHub Desktop.
rks-Mac-mini:sbase rk$ make
cc -std=c99 -Wall -pedantic -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_FILE_OFFSET_BITS=64 -o libutil/cp.o -c libutil/cp.c
libutil/cp.c:156:17: error: no member named 'st_atim' in 'struct stat'; did you mean 'st_atime'?
times[0] = st.st_atim;
^~~~~~~
st_atime
/usr/include/sys/stat.h:182:13: note: 'st_atime' declared here
struct stat __DARWIN_STRUCT_STAT64;
^
/usr/include/sys/stat.h:166:2: note: expanded from macro '__DARWIN_STRUCT_STAT64'
__DARWIN_STRUCT_STAT64_TIMES \
^
/usr/include/sys/stat.h:137:10: note: expanded from macro '__DARWIN_STRUCT_STAT64_TIMES'
time_t st_atime; /* [XSI] Time of last access */ \
^
libutil/cp.c:156:12: error: assigning to 'struct timespec' from incompatible type 'time_t' (aka 'long')
times[0] = st.st_atim;
^ ~~~~~~~~~~
libutil/cp.c:157:17: error: no member named 'st_mtim' in 'struct stat'; did you mean 'st_mtime'?
times[1] = st.st_mtim;
^~~~~~~
st_mtime
/usr/include/sys/stat.h:182:13: note: 'st_mtime' declared here
struct stat __DARWIN_STRUCT_STAT64;
^
/usr/include/sys/stat.h:166:2: note: expanded from macro '__DARWIN_STRUCT_STAT64'
__DARWIN_STRUCT_STAT64_TIMES \
^
/usr/include/sys/stat.h:139:10: note: expanded from macro '__DARWIN_STRUCT_STAT64_TIMES'
time_t st_mtime; /* [XSI] Last data modification time */ \
^
libutil/cp.c:157:12: error: assigning to 'struct timespec' from incompatible type 'time_t' (aka 'long')
times[1] = st.st_mtim;
^ ~~~~~~~~~~
libutil/cp.c:158:7: warning: implicit declaration of function 'utimensat' is invalid in C99 [-Wimplicit-function-declaration]
if (utimensat(AT_FDCWD, s2, times, AT_SYMLINK_NOFOLLOW) < 0) {
^
1 warning and 4 errors generated.
make: *** [libutil/cp.o] Error 1
rks-Mac-mini:sbase rk$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment