Since the modules are not compiled with the -std=c++0x build flags or equivalent, on OS X where the default compiler won't allow c++0x unless it's explicitly enabled causes the compiler fail to parse the ZNC headers (String.h) which uses C++0x features.
I would make a PR but not sure where to being with automake/conf.
Basically, to solve this locally I popped in -std=c++0x into CXXFLAGS in znc-buildmod.
The errors
[I] $ make
Building "palaver.so" for ZNC 1.6.0... In file included from palaver.cpp:11:
In file included from /usr/local/Cellar/znc/1.6.0/include/znc/Modules.h:21:
In file included from /usr/local/Cellar/znc/1.6.0/include/znc/WebModules.h:21:
In file included from /usr/local/Cellar/znc/1.6.0/include/znc/Template.h:21:
/usr/local/Cellar/znc/1.6.0/include/znc/ZNCString.h:60:6: warning: scoped enumerations are a C++11 extension
[-Wc++11-extensions]
enum class CaseSensitivity {
^
/usr/local/Cellar/znc/1.6.0/include/znc/ZNCString.h:85:47: error: 'CaseSensitivity' is not a class, namespace, or
scoped enumeration
static const CaseSensitivity CaseSensitive = CaseSensitivity::CaseSensitive;
^
/usr/local/Cellar/znc/1.6.0/include/znc/ZNCString.h:86:49: error: 'CaseSensitivity' is not a class, namespace, or
scoped enumeration
static const CaseSensitivity CaseInsensitive = CaseSensitivity::CaseInsensitive;
Since the modules are not compiled with the `-std=c++0x` build flags or equivalent, on OS X where the default compiler won't allow c++0x unless it's explicitly enabled causes the compiler fail to parse the ZNC headers (String.h) which uses C++0x features.
I would make a PR but not sure where to being with automake/conf.
Basically, to solve this locally I popped in `-std=c++0x` into CXXFLAGS in znc-buildmod.
### The errors
```
[I] $ make
Building "palaver.so" for ZNC 1.6.0... In file included from palaver.cpp:11:
In file included from /usr/local/Cellar/znc/1.6.0/include/znc/Modules.h:21:
In file included from /usr/local/Cellar/znc/1.6.0/include/znc/WebModules.h:21:
In file included from /usr/local/Cellar/znc/1.6.0/include/znc/Template.h:21:
/usr/local/Cellar/znc/1.6.0/include/znc/ZNCString.h:60:6: warning: scoped enumerations are a C++11 extension
[-Wc++11-extensions]
enum class CaseSensitivity {
^
/usr/local/Cellar/znc/1.6.0/include/znc/ZNCString.h:85:47: error: 'CaseSensitivity' is not a class, namespace, or
scoped enumeration
static const CaseSensitivity CaseSensitive = CaseSensitivity::CaseSensitive;
^
/usr/local/Cellar/znc/1.6.0/include/znc/ZNCString.h:86:49: error: 'CaseSensitivity' is not a class, namespace, or
scoped enumeration
static const CaseSensitivity CaseInsensitive = CaseSensitivity::CaseInsensitive;
```
From https://github.com/cocodelabs/znc-palaver/issues/20
<!-- github-sync-id:100183330 -->
./configure tries to find out what is the right argument to gcc for C++11 support. It records the result in CXXFLAGS itself. In the end of configure it generates znc-buildmod from znc-buildmod.in, and puts the value of CXXFLAGS to it.
My znc-buildmod has -std=c++11 in CXXFLAGS
How did you run ./configure? Was -std=c++0x at that time in CXXFLAGS? If it was, ./configure sees that g++ $CXXFLAGS already supports C++11, and doesn't record any special flag in CXXFLAGS itself.
`./configure` tries to find out what is the right argument to gcc for C++11 support. It records the result in CXXFLAGS itself. In the end of configure it generates znc-buildmod from znc-buildmod.in, and puts the value of CXXFLAGS to it.
My znc-buildmod has `-std=c++11` in `CXXFLAGS`
How did you run ./configure? Was `-std=c++0x` at that time in CXXFLAGS? If it was, ./configure sees that `g++ $CXXFLAGS` already supports C++11, and doesn't record any special flag in CXXFLAGS itself.
<!-- github-comment-id:129635586 -->
I think https://github.com/Homebrew/homebrew/blob/33aa9a09051c1260169f2de4e23834d68478ede3/Library/Formula/znc.rb#L31 adds `-std=c++11` to CXXFLAGS before calling ./configure
<!-- github-comment-id:129639696 -->
Update: ENV.cxx doesn't add -std=c++11 to CXXFLAGS, but it somehow bypasses that env variable, and enables C++11 in clang anyway.
Homebrew has fixed this.
Update: `ENV.cxx` doesn't add `-std=c++11` to `CXXFLAGS`, but it somehow bypasses that env variable, and enables C++11 in clang anyway.
<!-- github-comment-id:130485197 -->
ENV.cxx adds x to the env var HOMEBREW_CCCFG. With this, some wrapper around the compiler automatically adds std=cxx11 to every invocation of the compiler.
`ENV.cxx` adds `x` to the env var `HOMEBREW_CCCFG`. With this, some wrapper around the compiler automatically adds `std=cxx11` to every invocation of the compiler.
https://github.com/Homebrew/homebrew/blob/5596e28f3c4551a56b4b45f7875d60c08d0b6f2f/Library/Homebrew/extend/ENV/super.rb#L283-L293
https://github.com/Homebrew/homebrew/blob/33aa9a09051c1260169f2de4e23834d68478ede3/Library/ENV/4.3/cc#L314-L316 (This is the tool that messes with the compiler args and automatically adds the flag in the function in line 201)
<!-- github-comment-id:131731885 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Since the modules are not compiled with the
-std=c++0xbuild flags or equivalent, on OS X where the default compiler won't allow c++0x unless it's explicitly enabled causes the compiler fail to parse the ZNC headers (String.h) which uses C++0x features.I would make a PR but not sure where to being with automake/conf.
Basically, to solve this locally I popped in
-std=c++0xinto CXXFLAGS in znc-buildmod.The errors
From https://github.com/cocodelabs/znc-palaver/issues/20
./configuretries to find out what is the right argument to gcc for C++11 support. It records the result in CXXFLAGS itself. In the end of configure it generates znc-buildmod from znc-buildmod.in, and puts the value of CXXFLAGS to it.My znc-buildmod has
-std=c++11inCXXFLAGSHow did you run ./configure? Was
-std=c++0xat that time in CXXFLAGS? If it was, ./configure sees thatg++ $CXXFLAGSalready supports C++11, and doesn't record any special flag in CXXFLAGS itself.I think https://github.com/Homebrew/homebrew/blob/33aa9a09051c1260169f2de4e23834d68478ede3/Library/Formula/znc.rb#L31 adds
-std=c++11to CXXFLAGS before calling ./configureHomebrew has fixed this.
Update:
ENV.cxxdoesn't add-std=c++11toCXXFLAGS, but it somehow bypasses that env variable, and enables C++11 in clang anyway.ENV.cxxaddsxto the env varHOMEBREW_CCCFG. With this, some wrapper around the compiler automatically addsstd=cxx11to every invocation of the compiler.https://github.com/Homebrew/homebrew/blob/5596e28f3c4551a56b4b45f7875d60c08d0b6f2f/Library/Homebrew/extend/ENV/super.rb#L283-L293
https://github.com/Homebrew/homebrew/blob/33aa9a09051c1260169f2de4e23834d68478ede3/Library/ENV/4.3/cc#L314-L316 (This is the tool that messes with the compiler args and automatically adds the flag in the function in line 201)