[sane-devel] Using C++ in sane backends

Povilas Kanapickas povilas at radix.lt
Mon May 13 23:39:37 BST 2019


> 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.
> 
> 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.

I completely agree. I worked on a cross-platform game engine for a while
and had to work around certain differences of quality of implementation
across the supported compilers.

Of course everything depends on what baseline we want to target. If our
target is a 10 year old compiler then C++11 is definitely out of
consideration. On the other hand, if our baseline is something recent
then I think even C++11 is not very risky as most of the language itself
was supported quite well early on and it was the standard library that
needed time to catch up.

Regards,
Povilas




More information about the sane-devel mailing list