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

Avoid redefinition of strcasecmp under mingw-w64 #2102

Closed
wants to merge 1 commit into from

Conversation

mjwoods
Copy link
Contributor

@mjwoods mjwoods commented Sep 4, 2021

Fixes #2083

NetCDF defines strcasecmp as a preprocessor macro on Windows platforms. This is probably needed for the Microsoft compilers, but the header files used by mingw-w64 compilers define strcasecmp as an inline function.

If both the inline function and the macro definitions are used with gcc at high optimisation levels (specifically the flag -foptimize-sibling-calls, which is included by default at -O2 or higher), the OpenDAP tests hang.

On mingw-w64, the macro __MINGW32__ is defined in both 32-bit and 64-bit environments. If this macro is defined, the macro definition of strcasecmp can be disabled, which avoids the hang when running OpenDAP tests.

@mjwoods mjwoods requested a review from WardF as a code owner September 4, 2021 04:21
@mjwoods mjwoods closed this Sep 4, 2021
@mjwoods mjwoods deleted the mingw-strcasecmp branch September 4, 2021 07:03
@mjwoods
Copy link
Contributor Author

mjwoods commented Sep 4, 2021

This PR was replaced by #2106 , which is based on a more recent branch .

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.

OpenDAP hang on Mingw-w64
1 participant