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

CMake: set newer POSIX_C_SOURCE #682

Merged
merged 1 commit into from
Mar 16, 2023
Merged

CMake: set newer POSIX_C_SOURCE #682

merged 1 commit into from
Mar 16, 2023

Conversation

thesamesam
Copy link
Contributor

Enable POSIX 2008 as it's needed for strdup(), otherwise we get:

/var/tmp/portage/sys-libs/minizip-ng-3.0.9/work/minizip-ng-3.0.9/mz_os.c: In function ‘mz_dir_make’:
/var/tmp/portage/sys-libs/minizip-ng-3.0.9/work/minizip-ng-3.0.9/mz_os.c:286:19: error: implicit declaration of function ‘strdup’ [-Werror=implicit-function-declaration]
  286 |     current_dir = strdup(path);
      |                   ^~~~~~

The man page for strdup says:

strdup():
	_XOPEN_SOURCE >= 500
	|| /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
	|| /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE

Enable POSIX 2008 as it's needed for strdup(), otherwise we get:
```
/var/tmp/portage/sys-libs/minizip-ng-3.0.9/work/minizip-ng-3.0.9/mz_os.c: In function ‘mz_dir_make’:
/var/tmp/portage/sys-libs/minizip-ng-3.0.9/work/minizip-ng-3.0.9/mz_os.c:286:19: error: implicit declaration of function ‘strdup’ [-Werror=implicit-function-declaration]
  286 |     current_dir = strdup(path);
      |                   ^~~~~~
```

The man page for strdup says:
```
strdup():
	_XOPEN_SOURCE >= 500
	|| /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
	|| /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
```
@nmoinvaz nmoinvaz changed the base branch from master to develop March 16, 2023 23:39
@nmoinvaz nmoinvaz merged commit 36f6d72 into zlib-ng:develop Mar 16, 2023
@thesamesam thesamesam deleted the implicit-func-decl branch March 16, 2023 23:56
@thesamesam
Copy link
Contributor Author

Thanks!

@nmoinvaz nmoinvaz added platform specific Issue only affects a specific platform compilation Issues related to compiling source code and removed platform specific Issue only affects a specific platform labels Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compilation Issues related to compiling source code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants