[sane-devel] Using C++ in sane backends
paddy-hack at member.fsf.org
Mon May 13 12:28:22 BST 2019
Jon Chambers writes:
> Good afternoon,
> Speaking as a C++ dev on a cross-platform library as my day job (and a
> long-ago author of the dell1600n_net SANE driver) a word of caution:
> there is far more variation in the capabilities of C++ compilers than
> there is for C, for example MSVC is far more "forgiving" than gcc, and
> that's before you open the can of worms of C++-11 and beyond.
Thanks for chiming in. The WIP merge request that Povilas submitted
adds a check for a C++-11 without extensions.
Our builds enable a pile of compiler warnings by default and now that we
enable silent rules by default, they really stick out in the build logs.
On top of that, Our CI setup uses several versions of gcc and clang with
warnings turned into errors on Debian stable. I think that will help us
catch "deviant" behaviour fairly quickly.
# I'd like to turn warnings into errors on more setups but before that
# there's a bit of fixing warnings to be done to make the builds pass.
I have noticed that as we move through Alpine and Fedora distribution
versions the number of warning tends to increase :-(
# I^W We should get started cleaning some of that up, again.
> Not trying to put you off (I love C++ :-) ) but be aware you'll need to
> be careful to steer clear of newer features of the language.
Love is a big word but I also prefer C++ (warts and all) over plain C.
# But I'm mostly hacking shell, Node.js and Ruby these days ... :-/
Hope this helps,
Olaf Meeuwissen, LPIC-2 FSF Associate Member since 2004-01-27
GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13 F43E B8A4 A88A F84A 2DD9
Support Free Software https://my.fsf.org/donate
Join the Free Software Foundation https://my.fsf.org/join
More information about the sane-devel