Skip to content

Fix warnings on OSX#300

Closed
JohanEngelen wants to merge 1 commit intomadler:developfrom
JohanEngelen:patch-1
Closed

Fix warnings on OSX#300
JohanEngelen wants to merge 1 commit intomadler:developfrom
JohanEngelen:patch-1

Conversation

@JohanEngelen
Copy link
Copy Markdown

On OSX, we see warnings like these (abbreviated):

gzread.c: warning: implicit declaration of function 'read' is invalid in C99
gzread.c: warning: implicit declaration of function 'close' is invalid in C99
gzwrite.c: warning: implicit declaration of function 'write' is invalid in C99

Including <unistd.h> is needed on (at least) OSX to declare "read", "close", "write", and "lseek".

(Hope this is the right place to contribute patches. Thanks)

On OSX, we see warnings like these (abbreviated):
```
gzread.c: warning: implicit declaration of function 'read' is invalid in C99
gzread.c: warning: implicit declaration of function 'close' is invalid in C99
gzwrite.c: warning: implicit declaration of function 'write' is invalid in C99
```
Including <unistd.h> is needed on (at least) OSX to declare "read", "close", "write", and "lseek".
@madler
Copy link
Copy Markdown
Owner

madler commented Sep 9, 2017

That means you're not using ./configure.

@madler madler closed this Sep 9, 2017
@JohanEngelen JohanEngelen deleted the patch-1 branch September 9, 2017 09:36
@JohanEngelen
Copy link
Copy Markdown
Author

Indeed, we use zlib source as a subpart of our project and don't use zlib's configure.
Fixed by -DHAVE_UNISTD_H. Thanks for the hint.

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

Successfully merging this pull request may close these issues.

2 participants