Project

General

Profile

Bug #555

gcc-4.3 build issues 0.17

Added by Mark Purcell over 13 years ago. Updated almost 13 years ago.

Status:
Closed
Priority:
Normal
Category:
build
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

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.

Mark


Files

gcc4.3.diff (1.89 KB) gcc4.3.diff Redmine Admin, 10 Jun 2008 05:24

History

#1

Updated by Andreas Huggel over 13 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:

basicio.cpp
- 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?

XMPCore_Impl.hpp
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?

XMPMeta.cpp
This file includes XMPCore_Impl.hpp which in turn includes <cstring>. So the additional proposed #include here is redundant.

#2

Updated by Mark Purcell over 13 years ago

Andrew,

Thanks for your comments. I have now removed that patch from Debian GNU/Linux and we are building fine with gcc-4.3.

I'm happy for this bug to be closed..

Mark

Also available in: Atom PDF