znc-buildmod should possibly also test if compiler supports C++11 #604

Closed
opened 2026-10-05 04:32:43 +02:00 by adam · 1 comment
Owner

I use this script to configure ZNC and as Debian Oldstable has ancient clang it starts by unsetting CC and CXX so gcc gets used.

Testing https://github.com/znc/znc/pull/1130 I at first forgot to unset CC and CXX which resulted to a lot of errors:

% znc-buildmod alias.cpp 
Building "alias.so" for ZNC 1.7.x... In file included from alias.cpp:17:
/home/users/mikaela/.local/include/znc/Client.h:122:50: warning: use of GNU 'missing =' extension in designator [-Wgnu-designator]
                          m_mCoreCaps({{"multi-prefix", {false, [this](bool bVal) { m_bNamesx = bVal; }}},
                                                                      ^
                                                                      = 
/home/users/mikaela/.local/include/znc/Client.h:122:56: error: expected ')'
                          m_mCoreCaps({{"multi-prefix", {false, [this](bool bVal) { m_bNamesx = bVal; }}},
                                                                            ^
/home/users/mikaela/.local/include/znc/Client.h:122:50: note: to match this '('
                          m_mCoreCaps({{"multi-prefix", {false, [this](bool bVal) { m_bNamesx = bVal; }}},
                                                                      ^
/home/users/mikaela/.local/include/znc/Client.h:122:76: error: use of undeclared identifier 'bVal'
                          m_mCoreCaps({{"multi-prefix", {false, [this](bool bVal) { m_bNamesx = bVal; }}},
                                                                                                ^
/home/users/mikaela/.local/include/znc/Client.h:122:45: error: expression is not an integer constant expression
                          m_mCoreCaps({{"multi-prefix", {false, [this](bool bVal) { m_bNamesx = bVal; }}},
                                                                 ^~~~
/home/users/mikaela/.local/include/znc/Client.h:123:55: warning: use of GNU 'missing =' extension in designator [-Wgnu-designator]
                                       {"userhost-in-names", {false, [this](bool bVal) { m_bUHNames = bVal; }}},
                                                                           ^
                                                                           = 
/home/users/mikaela/.local/include/znc/Client.h:123:61: error: expected ')'
                                       {"userhost-in-names", {false, [this](bool bVal) { m_bUHNames = bVal; }}},
                                                                                 ^
/home/users/mikaela/.local/include/znc/Client.h:123:55: note: to match this '('
                                       {"userhost-in-names", {false, [this](bool bVal) { m_bUHNames = bVal; }}},
                                                                           ^
/home/users/mikaela/.local/include/znc/Client.h:123:82: error: use of undeclared identifier 'bVal'
                                       {"userhost-in-names", {false, [this](bool bVal) { m_bUHNames = bVal; }}},
                                                                                                      ^
/home/users/mikaela/.local/include/znc/Client.h:123:50: error: expression is not an integer constant expression
                                       {"userhost-in-names", {false, [this](bool bVal) { m_bUHNames = bVal; }}},
                                                                      ^~~~
/home/users/mikaela/.local/include/znc/Client.h:124:50: warning: use of GNU 'missing =' extension in designator [-Wgnu-designator]
                                       {"echo-message", {false, [this](bool bVal) { m_bEchoMessage = bVal; }}},
                                                                      ^
                                                                      = 
/home/users/mikaela/.local/include/znc/Client.h:124:56: error: expected ')'
                                       {"echo-message", {false, [this](bool bVal) { m_bEchoMessage = bVal; }}},
/home/users/mikaela/.local/include/znc/Client.h:124:50: note: to match this '('
                                       {"echo-message", {false, [this](bool bVal) { m_bEchoMessage = bVal; }}},
                                                                      ^
/home/users/mikaela/.local/include/znc/Client.h:124:81: error: use of undeclared identifier 'bVal'
                                       {"echo-message", {false, [this](bool bVal) { m_bEchoMessage = bVal; }}},
                                                                                                     ^
/home/users/mikaela/.local/include/znc/Client.h:124:45: error: expression is not an integer constant expression
                                       {"echo-message", {false, [this](bool bVal) { m_bEchoMessage = bVal; }}},
                                                                 ^~~~
/home/users/mikaela/.local/include/znc/Client.h:125:49: warning: use of GNU 'missing =' extension in designator [-Wgnu-designator]
                                       {"server-time", {false, [this](bool bVal) { m_bServerTime = bVal; }}},
                                                                     ^
                                                                     = 
/home/users/mikaela/.local/include/znc/Client.h:125:55: error: expected ')'
                                       {"server-time", {false, [this](bool bVal) { m_bServerTime = bVal; }}},
                                                                           ^
/home/users/mikaela/.local/include/znc/Client.h:125:49: note: to match this '('
                                       {"server-time", {false, [this](bool bVal) { m_bServerTime = bVal; }}},
                                                                     ^
/home/users/mikaela/.local/include/znc/Client.h:125:79: error: use of undeclared identifier 'bVal'
                                       {"server-time", {false, [this](bool bVal) { m_bServerTime = bVal; }}},
                                                                                                   ^
/home/users/mikaela/.local/include/znc/Client.h:125:44: error: expression is not an integer constant expression
                                       {"server-time", {false, [this](bool bVal) { m_bServerTime = bVal; }}},
                                                                ^~~~
/home/users/mikaela/.local/include/znc/Client.h:126:43: warning: use of GNU 'missing =' extension in designator [-Wgnu-designator]
                                       {"batch", {false, [this](bool bVal) { m_bBatch = bVal; }}},
                                                               ^
                                                               = 
/home/users/mikaela/.local/include/znc/Client.h:126:49: error: expected ')'
                                       {"batch", {false, [this](bool bVal) { m_bBatch = bVal; }}},
                                                                     ^
/home/users/mikaela/.local/include/znc/Client.h:126:43: note: to match this '('
                                       {"batch", {false, [this](bool bVal) { m_bBatch = bVal; }}},
                                                               ^
/home/users/mikaela/.local/include/znc/Client.h:126:68: error: use of undeclared identifier 'bVal'
                                       {"batch", {false, [this](bool bVal) { m_bBatch = bVal; }}},
                                                                                        ^
/home/users/mikaela/.local/include/znc/Client.h:126:38: error: expression is not an integer constant expression
                                       {"batch", {false, [this](bool bVal) { m_bBatch = bVal; }}},
                                                          ^~~~
/home/users/mikaela/.local/include/znc/Client.h:127:48: warning: use of GNU 'missing =' extension in designator [-Wgnu-designator]
                                       {"cap-notify", {false, [this](bool bVal) { m_bCapNotify = bVal; }}},
                                                                    ^
                                                                    = 
/home/users/mikaela/.local/include/znc/Client.h:127:54: error: expected ')'
                                       {"cap-notify", {false, [this](bool bVal) { m_bCapNotify = bVal; }}},
                                                                          ^
/home/users/mikaela/.local/include/znc/Client.h:127:48: note: to match this '('
                                       {"cap-notify", {false, [this](bool bVal) { m_bCapNotify = bVal; }}},
                                                                    ^
/home/users/mikaela/.local/include/znc/Client.h:127:77: error: use of undeclared identifier 'bVal'
                                       {"cap-notify", {false, [this](bool bVal) { m_bCapNotify = bVal; }}},
                                                                                                 ^
/home/users/mikaela/.local/include/znc/Client.h:127:43: error: expression is not an integer constant expression
                                       {"cap-notify", {false, [this](bool bVal) { m_bCapNotify = bVal; }}},
                                                               ^~~~
/home/users/mikaela/.local/include/znc/Client.h:128:48: warning: use of GNU 'missing =' extension in designator [-Wgnu-designator]
                                       {"away-notify", {true, [this](bool bVal) { m_bAwayNotify = bVal; }}},
                                                                    ^
                                                                    = 
/home/users/mikaela/.local/include/znc/Client.h:128:54: error: expected ')'
                                       {"away-notify", {true, [this](bool bVal) { m_bAwayNotify = bVal; }}},
                                                                          ^
/home/users/mikaela/.local/include/znc/Client.h:128:48: note: to match this '('
                                       {"away-notify", {true, [this](bool bVal) { m_bAwayNotify = bVal; }}},
                                                                    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
7 warnings and 20 errors generated.
[ !! ] Error while building "alias.so

I think this is caused by clang not understanding C++11 and causing the issue that way and znc-buildmod could have noticed this.

  • Debian GNU/Linux 7.9 (wheezy)
  • ZNC 1.7.x-git-441-d66cb36 - http://znc.in
    • IPv6: yes, SSL: yes, DNS: threads, charset: yes

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

I use [this script](https://github.com/Mikaela/scripts/blob/gh-pages/bash/zncconfigure) to configure ZNC and as Debian Oldstable has ancient clang it starts by unsetting CC and CXX so gcc gets used. Testing https://github.com/znc/znc/pull/1130 I at first forgot to unset CC and CXX which resulted to a lot of errors: ``` % znc-buildmod alias.cpp Building "alias.so" for ZNC 1.7.x... In file included from alias.cpp:17: /home/users/mikaela/.local/include/znc/Client.h:122:50: warning: use of GNU 'missing =' extension in designator [-Wgnu-designator] m_mCoreCaps({{"multi-prefix", {false, [this](bool bVal) { m_bNamesx = bVal; }}}, ^ = /home/users/mikaela/.local/include/znc/Client.h:122:56: error: expected ')' m_mCoreCaps({{"multi-prefix", {false, [this](bool bVal) { m_bNamesx = bVal; }}}, ^ /home/users/mikaela/.local/include/znc/Client.h:122:50: note: to match this '(' m_mCoreCaps({{"multi-prefix", {false, [this](bool bVal) { m_bNamesx = bVal; }}}, ^ /home/users/mikaela/.local/include/znc/Client.h:122:76: error: use of undeclared identifier 'bVal' m_mCoreCaps({{"multi-prefix", {false, [this](bool bVal) { m_bNamesx = bVal; }}}, ^ /home/users/mikaela/.local/include/znc/Client.h:122:45: error: expression is not an integer constant expression m_mCoreCaps({{"multi-prefix", {false, [this](bool bVal) { m_bNamesx = bVal; }}}, ^~~~ /home/users/mikaela/.local/include/znc/Client.h:123:55: warning: use of GNU 'missing =' extension in designator [-Wgnu-designator] {"userhost-in-names", {false, [this](bool bVal) { m_bUHNames = bVal; }}}, ^ = /home/users/mikaela/.local/include/znc/Client.h:123:61: error: expected ')' {"userhost-in-names", {false, [this](bool bVal) { m_bUHNames = bVal; }}}, ^ /home/users/mikaela/.local/include/znc/Client.h:123:55: note: to match this '(' {"userhost-in-names", {false, [this](bool bVal) { m_bUHNames = bVal; }}}, ^ /home/users/mikaela/.local/include/znc/Client.h:123:82: error: use of undeclared identifier 'bVal' {"userhost-in-names", {false, [this](bool bVal) { m_bUHNames = bVal; }}}, ^ /home/users/mikaela/.local/include/znc/Client.h:123:50: error: expression is not an integer constant expression {"userhost-in-names", {false, [this](bool bVal) { m_bUHNames = bVal; }}}, ^~~~ /home/users/mikaela/.local/include/znc/Client.h:124:50: warning: use of GNU 'missing =' extension in designator [-Wgnu-designator] {"echo-message", {false, [this](bool bVal) { m_bEchoMessage = bVal; }}}, ^ = /home/users/mikaela/.local/include/znc/Client.h:124:56: error: expected ')' {"echo-message", {false, [this](bool bVal) { m_bEchoMessage = bVal; }}}, /home/users/mikaela/.local/include/znc/Client.h:124:50: note: to match this '(' {"echo-message", {false, [this](bool bVal) { m_bEchoMessage = bVal; }}}, ^ /home/users/mikaela/.local/include/znc/Client.h:124:81: error: use of undeclared identifier 'bVal' {"echo-message", {false, [this](bool bVal) { m_bEchoMessage = bVal; }}}, ^ /home/users/mikaela/.local/include/znc/Client.h:124:45: error: expression is not an integer constant expression {"echo-message", {false, [this](bool bVal) { m_bEchoMessage = bVal; }}}, ^~~~ /home/users/mikaela/.local/include/znc/Client.h:125:49: warning: use of GNU 'missing =' extension in designator [-Wgnu-designator] {"server-time", {false, [this](bool bVal) { m_bServerTime = bVal; }}}, ^ = /home/users/mikaela/.local/include/znc/Client.h:125:55: error: expected ')' {"server-time", {false, [this](bool bVal) { m_bServerTime = bVal; }}}, ^ /home/users/mikaela/.local/include/znc/Client.h:125:49: note: to match this '(' {"server-time", {false, [this](bool bVal) { m_bServerTime = bVal; }}}, ^ /home/users/mikaela/.local/include/znc/Client.h:125:79: error: use of undeclared identifier 'bVal' {"server-time", {false, [this](bool bVal) { m_bServerTime = bVal; }}}, ^ /home/users/mikaela/.local/include/znc/Client.h:125:44: error: expression is not an integer constant expression {"server-time", {false, [this](bool bVal) { m_bServerTime = bVal; }}}, ^~~~ /home/users/mikaela/.local/include/znc/Client.h:126:43: warning: use of GNU 'missing =' extension in designator [-Wgnu-designator] {"batch", {false, [this](bool bVal) { m_bBatch = bVal; }}}, ^ = /home/users/mikaela/.local/include/znc/Client.h:126:49: error: expected ')' {"batch", {false, [this](bool bVal) { m_bBatch = bVal; }}}, ^ /home/users/mikaela/.local/include/znc/Client.h:126:43: note: to match this '(' {"batch", {false, [this](bool bVal) { m_bBatch = bVal; }}}, ^ /home/users/mikaela/.local/include/znc/Client.h:126:68: error: use of undeclared identifier 'bVal' {"batch", {false, [this](bool bVal) { m_bBatch = bVal; }}}, ^ /home/users/mikaela/.local/include/znc/Client.h:126:38: error: expression is not an integer constant expression {"batch", {false, [this](bool bVal) { m_bBatch = bVal; }}}, ^~~~ /home/users/mikaela/.local/include/znc/Client.h:127:48: warning: use of GNU 'missing =' extension in designator [-Wgnu-designator] {"cap-notify", {false, [this](bool bVal) { m_bCapNotify = bVal; }}}, ^ = /home/users/mikaela/.local/include/znc/Client.h:127:54: error: expected ')' {"cap-notify", {false, [this](bool bVal) { m_bCapNotify = bVal; }}}, ^ /home/users/mikaela/.local/include/znc/Client.h:127:48: note: to match this '(' {"cap-notify", {false, [this](bool bVal) { m_bCapNotify = bVal; }}}, ^ /home/users/mikaela/.local/include/znc/Client.h:127:77: error: use of undeclared identifier 'bVal' {"cap-notify", {false, [this](bool bVal) { m_bCapNotify = bVal; }}}, ^ /home/users/mikaela/.local/include/znc/Client.h:127:43: error: expression is not an integer constant expression {"cap-notify", {false, [this](bool bVal) { m_bCapNotify = bVal; }}}, ^~~~ /home/users/mikaela/.local/include/znc/Client.h:128:48: warning: use of GNU 'missing =' extension in designator [-Wgnu-designator] {"away-notify", {true, [this](bool bVal) { m_bAwayNotify = bVal; }}}, ^ = /home/users/mikaela/.local/include/znc/Client.h:128:54: error: expected ')' {"away-notify", {true, [this](bool bVal) { m_bAwayNotify = bVal; }}}, ^ /home/users/mikaela/.local/include/znc/Client.h:128:48: note: to match this '(' {"away-notify", {true, [this](bool bVal) { m_bAwayNotify = bVal; }}}, ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 7 warnings and 20 errors generated. [ !! ] Error while building "alias.so ``` I think this is caused by clang not understanding C++11 and causing the issue that way and znc-buildmod could have noticed this. - Debian GNU/Linux 7.9 (wheezy) - ZNC 1.7.x-git-441-d66cb36 - http://znc.in - IPv6: yes, SSL: yes, DNS: threads, charset: yes ## <bountysource-plugin> Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/26981748-znc-buildmod-should-possibly-also-test-if-compiler-supports-c-11?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github). </bountysource-plugin> <!-- github-sync-id:108530542 -->
adam closed this issue 2026-10-05 04:32:43 +02:00
Author
Owner

When ZNC is built using CMake, znc-buildmod has this feature.

When ZNC is built using CMake, znc-buildmod has this feature. <!-- github-comment-id:450724808 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#604