Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ugly compiler warning on MinGW/msys2 from src/localhost.c #571

Closed
clanmills opened this issue Nov 27, 2018 · 1 comment
Closed

Ugly compiler warning on MinGW/msys2 from src/localhost.c #571

clanmills opened this issue Nov 27, 2018 · 1 comment
Assignees
Milestone

Comments

@clanmills
Copy link
Collaborator

514 MSYS64:rmills@rmillsmbp-w7:~/gnu/github/exiv2/exiv2/build $ make
[ 18%] Built target xmp
Scanning dependencies of target exiv2lib_int
[ 20%] Building C object src/CMakeFiles/exiv2lib_int.dir/localtime.c.o
/c/msys64/home/rmills/gnu/github/exiv2/exiv2/src/localtime.c: In function 'tzload':
/c/msys64/home/rmills/gnu/github/exiv2/exiv2/src/localtime.c:268:19: warning: implicit declaration of function 'access' [-Wimplicit-function-declaration]
   if (doaccess && access(name, R_OK) != 0)
                   ^~~~~~
/c/msys64/home/rmills/gnu/github/exiv2/exiv2/src/localtime.c:282:7: warning: implicit declaration of function 'read'; did you mean 'fread'? [-Wimplicit-function-declaration]
   i = read(fid, u.buf, sizeof u.buf);
       ^~~~
       fread
/c/msys64/home/rmills/gnu/github/exiv2/exiv2/src/localtime.c:283:7: warning: implicit declaration of function 'close'; did you mean 'pclose'? [-Wimplicit-function-declaration]
   if (close(fid) != 0)
       ^~~~~
       pclose
[ 45%] Built target exiv2lib_int
[ 46%] Linking CXX shared library ../bin/msys-exiv2-27.dll
make[2]: *** Deleting file 'bin/msys-exiv2-27.dll'
make[2]: *** [src/CMakeFiles/exiv2lib.dir/build.make:1240: bin/msys-exiv2-27.dll] Interrupt
make[1]: *** [CMakeFiles/Makefile2:178: src/CMakeFiles/exiv2lib.dir/all] Interrupt
make: *** [Makefile:130: all] Interrupt

515 MSYS64:rmills@rmillsmbp-w7:~/gnu/github/exiv2/exiv2/build $

Fix is easy:

512 MSYS64:rmills@rmillsmbp-w7:~/gnu/github/exiv2/exiv2/build $ git diff
diff --git a/src/localtime.c b/src/localtime.c
index 3ec0925c..55ad84ff 100644
--- a/src/localtime.c
+++ b/src/localtime.c
@@ -5,6 +5,9 @@

 #include "config.h"
 #include "timegm.h"
+#ifdef   EXV_HAVE_UNISTD_H
+#include "unistd.h"
+#endif

 /*
 ** This file is in the public domain, so clarified as of
513 MSYS64:rmills@rmillsmbp-w7:~/gnu/github/exiv2/exiv2/build $
@clanmills clanmills added this to the v0.27 milestone Nov 27, 2018
clanmills added a commit that referenced this issue Nov 27, 2018
clanmills added a commit that referenced this issue Nov 28, 2018
piponazo pushed a commit that referenced this issue Nov 29, 2018
piponazo pushed a commit that referenced this issue Nov 29, 2018
@piponazo
Copy link
Collaborator

Since this is fixed in #557 (which will be merged tomorrow), I'll close this issue.

piponazo pushed a commit that referenced this issue Nov 30, 2018
piponazo pushed a commit that referenced this issue Nov 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants