libmodbus
libmodbus copied to clipboard
Fix portable build of libmodbus (upstream)
Upstream the work done for NUT fork of libmodbus, without the RTU USB pieces at the moment - see https://github.com/networkupstools/libmodbus/pull/4 for the equivalent PR there
This subset of those changes focuses more strictly on passing builds without warnings, due to regressions allegedly due to upstream v3.1.10->v3.1.11 bump, so these fixes could be up-streamed separately:
- changes in
rtu_usbbranch not as portable as they should be (printing of int types) - casting of
setsockopt()pointer to data - use of
inet_ntop()/inet_pton()absent on Windows (at least MINGW on Linux cross-build environments, MSYS2 does not seem to suffer this one) -configuredetection and fallback implementation code imported from NUT ip.hneedsin.hexplicitly on some platforms
Enhancements:
- allow to
./configure --enable-Werrorin test builds, to fail the build upon any compiler warnings (not enabled by default), allowing to easily iterate on the code fixes - enhance some debug printouts, add end-of-lines and and console flushing before/after certain messages
There is a separate stack of commits focused on passing make check as well -- the unit-test changes in https://github.com/networkupstools/libmodbus/pull/3, but those are a bit more questionable even to myself (e.g. should flushing be done between tests and/or if some fail? how much should we rely on tight timings in "7ms > 5ms" tests where OS clock for context switches may be not so precise? etc.)
NOTE: I've posted the form for CLA bot some weeks ago, did not see any master-branch changes about that though. Posted another today, just in case.
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient...
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient...
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient...
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient...
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient...
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient...