Closed Nindaleth closed 3 years ago
Fixed the assignment from temporary
warning.
For pixmapcodeccommon.cpp
not sure how to go about it: stbiSkip
is a stbi_io callback and it must return void,
Looks like there is no way to propagate error, if IDevice::seek fails:
stbi does't check 'seek-operation'
exception is no an option - it will break a stbi internal cleanup
Thanks for the fix!
For the other warning, if silencing it in this specific spot is acceptable, I've found two ways, one is standard C++17 (and so may not be usable by this project yet) [[maybe_unused]]
:
static void stbiSkip(void* user, int n) {
[[maybe_unused]] size_t s = reinterpret_cast<IDevice*>(user)->seek(size_t(n));
}
the other one is a discarding workaround:
template<typename T>
void discard(const T&) {}
...
static void stbiSkip(void* user, int n) {
discard(reinterpret_cast<IDevice*>(user)->seek(size_t(n)));
}
I can confirm both silence the warning. I suppose if a complete solution is needed, stbi_image uptream would have to improve the stbi__skip
implementation.
I've noticed two warnings when compiling on Linux Fedora 32 using GCC 10.2.1: