I'm running into an odd issue where gcc appears to be changing the function signature and discarding a const qualifier on a parmaeter.
I have a method in a namespace declared as
namespace Foo {
bool CompressJPEG_8(const Buffer &input,
const unsigned int nWidth, const unsigned int nHeight,
const unsigned int nNumComponents, Buffer &compressed);
}
gcc complains that the method Foo::CompressJPEG_08(Foo::Buffer const& input ... )
is an undefined reference.
When I run nm, on the generated object code I see:
U Foo::CompressJPEG_8(Foo::Buffer const&, unsigned int, unsigned int, unsigned int, Foo::Buffer&)
0000000000192f5c T Foo::CompressJPEG_8(Foo::Buffer&, unsigned int, unsigned int, unsigned int, Foo::Buffer&)
For some reason gcc has removed the const
qualifier on the first parameter and I can't figure out why. I suspect that is has something to do with the fact that the jpeg library methods are declared in anextern
"C" { }
block but I'm not sure why.