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

Missing header <unistd.h> from file check.c #186

Closed
mikkoi opened this issue May 14, 2019 · 6 comments
Closed

Missing header <unistd.h> from file check.c #186

mikkoi opened this issue May 14, 2019 · 6 comments

Comments

@mikkoi
Copy link
Contributor

mikkoi commented May 14, 2019

[ 17%] Building C object src/CMakeFiles/check.dir/check.c.o
/Users/[******]/check/src/check.c:393:9: warning: implicitly declaring library function '_exit' with type
      'void (int) __attribute__((noreturn))' [-Wimplicit-function-declaration]
        _exit(1);
        ^
/Users/[******]/check/src/check.c:393:9: note: include the header <unistd.h> or explicitly provide a declaration for '_exit'
/Users/[******]/check/src/check.c:604:16: warning: result of comparison of constant 4294967295 with expression of type
      'clockid_t' is always false [-Wtautological-constant-out-of-range-compare]
    if(clockid == -1)
       ~~~~~~~ ^  ~~
2 warnings generated.
@mikkoi
Copy link
Contributor Author

mikkoi commented May 14, 2019

Since header <unistd.h> is not portable (is part of POSIX standard), it needs to be added in a portable way, maybe the same way it is used...

#if defined(HAVE_FORK) && HAVE_FORK==1
        _exit(1);
#endif /* HAVE_FORK */

@brarcher
Copy link
Contributor

Interesting. What platform are you seeing this on? I'm guessing from the paths that it is on macOS. When I try compiling master on my macOS machine I do not see that warning.

check.c includes libcompat.h, and that has the following:

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

I would expect that unistd.h would be included if configure found it. I wonder why configure did not find it on your system.

@mikkoi
Copy link
Contributor Author

mikkoi commented May 15, 2019

It happens on MacOS. I have not run ./configure at all, just using the CMake build. (autoreconf --install fails on MacOS as well, but that's another story.)

@mikkoi
Copy link
Contributor Author

mikkoi commented May 15, 2019

This raises the bigger question, do we want to support both CMake build and autoconf (GNU) build?

@mikkoi
Copy link
Contributor Author

mikkoi commented May 16, 2019

What I meant with my question, was "Does check continue to support both GNU and CMake build, or in the future only CMake build?"
I created another build request for an advanced CMake build which uses the CMake 3 new export system.

@mikkoi
Copy link
Contributor Author

mikkoi commented Jun 24, 2019

I have fixed this in f00f503

@mikkoi mikkoi closed this as completed Jun 24, 2019
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