Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 212581

Summary: dev-db/mysql++-2.3 doesn't compile w/ gcc-4.3
Product: Gentoo Linux Reporter: Sektor van Skijlen <ethouris>
Component: [OLD] GCC PortingAssignee: Gentoo Linux MySQL bugs team <mysql-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 198121    
Attachments: mysql++-2.3.2-gcc-4.3.patch

Description Sektor van Skijlen 2008-03-07 13:25:11 UTC
dev-db/mysql++ fails.

Reports: from lib/const_string.h file, no definition of 'memcpy' found.
Reason: The #include <cstring> is missing from const_string.h file.

The type of the bug is that it "may fail on some systems or some gcc versions".

It really doesn't matter, which version of gcc I was using (ok, I used 4.3.0 pre-release). Thing that matter is that the code is ISO C++ standard counter-correct.

It *may work* on some compilers anyway (or some compilers' versions) by the reason that '#include <string>' declaration includes <cstring> as well, but *programmer should never state this a sure thing*. Need 'memcpy' or 'strcpy' = use '#include <cstring>'.

Reproducible: Always

Steps to Reproduce:
1. Try to install mysql++ (I used paludis)

Actual Results:  
Reports compile errors: in lib/const_sring.h definition for 'memcpy' is not found.

Expected Results:  
Should report no compile errors. :)

Severity: normal, however note that it blocks using other packages that depend on mysql++.
How to fix:

In lib/const_string.h file, after this line:

#include <string>

add the following:

#include <cstring>

Note: *not replace* <string> with <cstring>. Both are needed, as the class defined in this file uses both 'memcpy' and 'std::string'.
Comment 1 Ryan Hill (RETIRED) gentoo-dev 2008-03-22 22:30:05 UTC
Created attachment 146956 [details, diff]
mysql++-2.3.2-gcc-4.3.patch
Comment 2 Ryan Hill (RETIRED) gentoo-dev 2008-04-21 03:00:54 UTC
Applied.