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

Build on AIX fails because "opj_includes.h" is included after system headers #633

Closed
smuehlst opened this issue Oct 15, 2015 · 1 comment
Labels
Milestone

Comments

@smuehlst
Copy link
Contributor

This is a follow-up to issue #620. The fix for the restrict pointers lets the build progress further, but the build now fails on a subsequent file:

[ 25%] Building C object src/lib/openjp2/CMakeFiles/openjp2.dir/opj_clock.c.o
"/usr/include/stdio.h", line 498.12: 1506-343 (S) Redeclaration of fgetpos64 differs from previous declaration on line 297 of "/usr/include/stdio.h".
"/usr/include/stdio.h", line 498.12: 1506-377 (I) The type "long long*" of parameter 2 differs from the previous type "long* restrict".
"/usr/include/stdio.h", line 501.12: 1506-343 (S) Redeclaration of fseeko64 differs from previous declaration on line 441 of "/usr/include/stdio.h".
"/usr/include/stdio.h", line 501.12: 1506-377 (I) The type "long long" of parameter 2 differs from the previous type "long".
"/usr/include/stdio.h", line 502.12: 1506-343 (S) Redeclaration of fsetpos64 differs from previous declaration on line 299 of "/usr/include/stdio.h".
"/usr/include/stdio.h", line 502.12: 1506-377 (I) The type "const long long*" of parameter 2 differs from the previous type "const long*".
"/usr/include/stdio.h", line 503.16: 1506-343 (S) Redeclaration of ftello64 differs from previous declaration on line 442 of "/usr/include/stdio.h".
"/usr/include/stdio.h", line 503.16: 1506-050 (I) Return type "long long" in redeclaration is not compatible with the previous return type "long".
"/home/stm/src/openjpeg_aix/src/lib/openjp2/openjpeg.h", line 75.9: 1506-224 (I) Incorrect pragma ignored.

I tracked this down to the fact the "opj_includes.h" is included after system headers in opj_clock.c:

#ifdef _WIN32
#include <windows.h>
#else
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/times.h>
#endif /* _WIN32 */
#include "opj_includes.h"

Inside "opj_includes.h" "opj_config_private.h" is included, and the comment says that is must be included before any system headers:

/*
 * This must be included before any system headers,
 * since they can react to macro defined there
 */
#include "opj_config_private.h"

This requirement is violated by including "opj_includes.h" after system headers in opj_clock.c. If I move the "opj_includes" to the top in opj_clock.c, it compiles successfully.

smuehlst pushed a commit to smuehlst/openjpeg that referenced this issue Oct 15, 2015
"opj_includes.h" must be included before system headers, otherwise
inconsistent definitions of configuration macros lead to build
failures on AIX.
@smuehlst
Copy link
Contributor Author

Created pull request #634-

@mayeut mayeut closed this as completed in ee04854 Oct 15, 2015
@mayeut mayeut added this to the OPJ v2.1.1 milestone Oct 18, 2015
@mayeut mayeut added the bug label Oct 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants