nginx compiles with -Werror (treating warnings as errors)
CentOS 6 has OpenSSL 1.0.1e, thus the LDAP module has a warning on compile
CentOS 6 has GCC 4.4. The version of GCC treats the LDAP module's statement #pragma GCC diagnostic warning "-Wcpp" as an error itself and thus skips the statement, leading to the #warning still being an error.
This adds version-checking to the warning options and the warning
itself. This means that no warning is issued at compile time on this
type of platform, but warnings are still emitted when starting Nginx
without certificate verification, so the issue is still visible in a notable way.
Other solutions to making this module compile on CentOS 6 / GCC 4.4 are welcomed, but this seems like the lightest touch.
As per #138 (and specifically https://github.com/kvspb/nginx-auth-ldap/issues/138#issuecomment-317625746) the issue is that:
-Werror
(treating warnings as errors)#pragma GCC diagnostic warning "-Wcpp"
as an error itself and thus skips the statement, leading to the#warning
still being an error.This adds version-checking to the warning options and the warning itself. This means that no warning is issued at compile time on this type of platform, but warnings are still emitted when starting Nginx without certificate verification, so the issue is still visible in a notable way.
Other solutions to making this module compile on CentOS 6 / GCC 4.4 are welcomed, but this seems like the lightest touch.