Skip to content

fightwarn - nutclient.{h,cpp} : fix an horde of warnings#902

Merged
jimklimov merged 26 commits intonetworkupstools:masterfrom
jimklimov:fightwarn-lgtm-com-cxx
Nov 27, 2020
Merged

fightwarn - nutclient.{h,cpp} : fix an horde of warnings#902
jimklimov merged 26 commits intonetworkupstools:masterfrom
jimklimov:fightwarn-lgtm-com-cxx

Conversation

@jimklimov
Copy link
Copy Markdown
Member

After a practical fix for #880, at least 50 errors were emitted by clang-9 for the remaining C++ code in this file. Most though not all taste of syntactic sugar, but whatever - if it helps the code be clean and nice.

Follows up from #823 / #844 efforts.

Comment thread clients/nutclient.cpp
…rnings about C++98 compatibility that we do not claim anyway - check that we have pragmas for that
… warnings about C++98 compatibility that we do not claim anyway - quiesce in C++ source
…global-constructors handling for an std:string static variable
…ses into CPP file to bolt a linker unit (avoid Weak Vtables warnings and related build overheads)
…RFLOW detection to quiesce warnings about "%s" resolving from NULL pointer

First shot at issue NUT networkupstools#904
…STIC_IGNORED_GLOBAL_CONSTRUCTORS et al to avoid warnings for CPPUnit macro implementation (boils down to static vars)
@jimklimov jimklimov force-pushed the fightwarn-lgtm-com-cxx branch from 0ca9faa to 10677aa Compare November 26, 2020 23:21
@jimklimov jimklimov merged commit 4e6e6f3 into networkupstools:master Nov 27, 2020
@jimklimov jimklimov deleted the fightwarn-lgtm-com-cxx branch November 27, 2020 19:12
@bkuhls
Copy link
Copy Markdown

bkuhls commented Mar 21, 2021

This commit breaks cross-builds:

checking for practical support to pritnf("%s", NULL)... configure: error: in `nut-fbe7806e83f2838da21a0c7d56649777780881c1':
configure: error: cannot run test program while cross compiling

A hackish fix is to add ax_cv__printf_string_null=yes to the configure environment.

@jimklimov
Copy link
Copy Markdown
Member Author

jimklimov commented Mar 21, 2021 via email

@bkuhls
Copy link
Copy Markdown

bkuhls commented Mar 21, 2021

Can you clarify the cross-setup you have

The issue occured while bumping the buildroot package from version 2.7.4
https://github.com/buildroot/buildroot/blob/master/package/nut/nut.mk
to its current git HEAD: bkuhls/buildroot@8d135b7

To reproduce the problem use buildroot to build nut with my commit but without https://github.com/bkuhls/buildroot/blob/master_patches/package/nut/nut.mk#L33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C++ ready / code review Author (and CI) consider the PR worthy of human rewievers' time

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants