support for 32-bit platforms for the tutorial in the README
Hi German,
I recently updated the libsecrecy package to version 0.0.5 in Debian, but when building the small tutorial described in the README on i386 and armhf platforms, their compilation fails with the following errors:
In file included from decrypt.cpp:1:
In file included from /usr/include/libsecrecy/GCMInputStream.hpp:29:
/usr/include/libsecrecy/GCMInputStreamBuffer.hpp:190:47: error: use of overloaded operator '-' is ambiguous (with operand types 'std::streampos' (aka 'fpos<__mbstate_t>') and 'int')
std::streampos const curpos = blockoffset - (egptr()-gptr());
~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/i686-linux-gnu/10/../../../../include/c++/10/bits/postypes.h:198:7: note: candidate function
operator-(streamoff __off) const
^
/usr/bin/../lib/gcc/i686-linux-gnu/10/../../../../include/c++/10/bits/postypes.h:211:7: note: candidate function
operator-(const fpos& __other) const
^
/usr/include/libsecrecy/GCMInputStreamBuffer.hpp:190:47: note: built-in candidate operator-(long long, int)
std::streampos const curpos = blockoffset - (egptr()-gptr());
^
/usr/include/libsecrecy/GCMInputStreamBuffer.hpp:190:47: note: built-in candidate operator-(float, int)
/usr/include/libsecrecy/GCMInputStreamBuffer.hpp:190:47: note: built-in candidate operator-(double, int)
[...]
/usr/include/libsecrecy/GCMInputStreamBuffer.hpp:190:47: note: built-in candidate operator-(unsigned long long, unsigned long long)
/usr/include/libsecrecy/GCMInputStreamBuffer.hpp:228:29: error: use of overloaded operator '-' is ambiguous (with operand types 'std::streampos' (aka 'fpos<__mbstate_t>') and 'std::streamsize' (aka 'int'))
bufstart = blockoffset - static_cast<std::streamsize>(egptr()-eback());
~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/i686-linux-gnu/10/../../../../include/c++/10/bits/postypes.h:198:7: note: candidate function
operator-(streamoff __off) const
^
/usr/bin/../lib/gcc/i686-linux-gnu/10/../../../../include/c++/10/bits/postypes.h:211:7: note: candidate function
operator-(const fpos& __other) const
^
/usr/include/libsecrecy/GCMInputStreamBuffer.hpp:228:29: note: built-in candidate operator-(long long, int)
bufstart = blockoffset - static_cast<std::streamsize>(egptr()-eback());
^
/usr/include/libsecrecy/GCMInputStreamBuffer.hpp:228:29: note: built-in candidate operator-(float, int)
/usr/include/libsecrecy/GCMInputStreamBuffer.hpp:228:29: note: built-in candidate operator-(double, int)
[...]
/usr/include/libsecrecy/GCMInputStreamBuffer.hpp:228:29: note: built-in candidate operator-(unsigned long long, unsigned long long)
/usr/include/libsecrecy/GCMInputStreamBuffer.hpp:249:47: error: use of overloaded operator '-' is ambiguous (with operand types 'std::streampos' (aka 'fpos<__mbstate_t>') and 'int')
std::streampos const curpos = blockoffset - (egptr()-gptr());
~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/i686-linux-gnu/10/../../../../include/c++/10/bits/postypes.h:198:7: note: candidate function
operator-(streamoff __off) const
^
/usr/bin/../lib/gcc/i686-linux-gnu/10/../../../../include/c++/10/bits/postypes.h:211:7: note: candidate function
operator-(const fpos& __other) const
^
/usr/include/libsecrecy/GCMInputStreamBuffer.hpp:249:47: note: built-in candidate operator-(long long, int)
std::streampos const curpos = blockoffset - (egptr()-gptr());
^
/usr/include/libsecrecy/GCMInputStreamBuffer.hpp:249:47: note: built-in candidate operator-(float, int)
[...]
A full log is available on Debian CI platform and I wrapped up a patch to fix/workaround the issue on Salsa.
Curiously, the issue didn't seem to affect the building of the libmaus2 2.0.806 apparently on a first sight, but I'm still waiting for buildd results to be certain.
In hope this helps,
Have a nice day, :)
Étienne Mollier