gcc-4.3 build issues 0.17
Hi saw the fix at id=547 for gcc-4.3 building.
In the Debian/ GNU Linux package of exiv2 we have some additional gcc-4.3 patches which assist with building with this compiler and I would be please if you could review and include upstream.
Updated by Andreas Huggel almost 12 years ago
In general, if I include a C header xyz.h as #include <cxyz> then the functions are wrapped in the C++ std namespace and without any 'using directive'.
Compilers in the past have usually not enforced this rule, so it usually didn't matter whether the std:: prefix was used for C functions included that way. For all I know, using it might actually cause a compiler error on older compilers.
However, g++-4.3 is more strict in this area and doesn't compile some of this non-standard code anymore. The way I tried to fix these issues was by using standard C++: #include <cxyz> and use the C functions defined in cxyz with a std:: prefix where needed.
Specifically, to the proposed changes:
- std::memcpy(data, data_, size_);
+ memcpy(data, data_, size_);
All other 61 occurrences of memcpy in the source code in this directory have the std:: qualifier. Do you really need to change just this one back to the non-standards-compliant syntax?
This file includes <cstring>, so it is correct to use std::strncmp and std::strlen. Do you get a compiler error for any platform that requires to remove std:: here?
This file includes XMPCore_Impl.hpp which in turn includes <cstring>. So the additional proposed #include here is redundant.