dbTalk Databases Forums  

[PATCH] gcc 4.0.0 fixes

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss [PATCH] gcc 4.0.0 fixes in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Chris Frey
 
Posts: n/a

Default [PATCH] gcc 4.0.0 fixes - 05-04-2005 , 04:56 AM






Hi there,

Some fixes here that make mysql++ compile more cleanly with the new
GCC 4.0.0. I'm liking this compiler so far. Seems fast too.

This fixes:
- some virtual destructors for classes that have virtual functions.
- warnings about unused arguments
- cast warnings

The fixes in the .cpp files aren't that important, since it only happens
once, but the .h files can affect user code. This also affects the
ABI in some places (?).

- Chris


Index: software/mysql++/lib/datetime.h
diff -u software/mysql++/lib/datetime.h:1.4 software/mysql++/lib/datetime.h:1.5
--- software/mysql++/lib/datetime.h:1.4 Mon May 2 06:25:53 2005
+++ software/mysql++/lib/datetime.h Wed May 4 04:59:10 2005
@@ -22,6 +22,8 @@
virtual std:stream& out_stream(std:stream&) const = 0;

operator std::string ();
+
+ virtual ~mysql_dt_base() {}
};

/// \if INTERNAL
@@ -37,6 +39,8 @@
bool operator <= (const T &other) const {return compare(other) <= 0;}
bool operator > (const T &other) const {return compare(other) > 0;}
bool operator >= (const T &other) const {return compare(other) >= 0;}
+
+ virtual ~DTbase() {}
};

/// \endif
Index: software/mysql++/lib/null.h
diff -u software/mysql++/lib/null.h:1.4 software/mysql++/lib/null.h:1.5
--- software/mysql++/lib/null.h:1.4 Mon May 2 06:25:53 2005
+++ software/mysql++/lib/null.h Wed May 4 04:59:10 2005
@@ -89,8 +89,8 @@
typedef void value_type;
public:
Null () : is_null(false) { }
- Null (const null_type &n) : is_null(true) { }
- Null& operator = (const null_type &n) { is_null = true; return *this; }
+ Null (const null_type &) : is_null(true) { }
+ Null& operator = (const null_type &) { is_null = true; return *this; }
};

/// \endif
Index: software/mysql++/lib/resiter.h
diff -u software/mysql++/lib/resiter.h:1.5 software/mysql++/lib/resiter.h:1.6
--- software/mysql++/lib/resiter.h:1.5 Mon May 2 06:25:53 2005
+++ software/mysql++/lib/resiter.h Wed May 4 04:59:10 2005
@@ -56,6 +56,8 @@

reverse_iterator rbegin() const { return reverse_iterator(end()); }
reverse_iterator rend() const { return reverse_iterator(begin()); }
+
+ virtual ~const_subscript_container() {}
};


Index: software/mysql++/lib/sql_query.cpp
diff -u software/mysql++/lib/sql_query.cpp:1.4 software/mysql++/lib/sql_query.cpp:1.5
--- software/mysql++/lib/sql_query.cpp:1.4 Mon May 2 06:25:53 2005
+++ software/mysql++/lib/sql_query.cpp Wed May 4 04:59:10 2005
@@ -48,7 +48,7 @@

if (option == 'r' || (option == 'q' && S.is_string)) {
char *s = new char[S.size() * 2 + 1];
- mysql_escape_string(s, S.c_str(), (unsigned long) S.size());
+ mysql_escape_string(s, S.c_str(), static_cast <unsigned long> (S.size()));
SQLString *ss = new SQLString("'");
*ss += s;
*ss += "'";
Index: software/mysql++/lib/manip.cpp
diff -u software/mysql++/lib/manip.cpp:1.3 software/mysql++/lib/manip.cpp:1.4
--- software/mysql++/lib/manip.cpp:1.3 Mon May 2 06:25:53 2005
+++ software/mysql++/lib/manip.cpp Wed May 4 04:59:10 2005
@@ -19,7 +19,7 @@
}
else {
char *s = new char[in.size() * 2 + 1];
- mysql_escape_string(s, in.c_str(), (unsigned long)in.size());
+ mysql_escape_string(s, in.c_str(), static_cast <unsigned long> (in.size()));
SQLString in2 = SQLString("'") + s + "'";
in2.processed = true;
*p.qparms << in2;
@@ -37,7 +37,7 @@
ostream& operator<<(quote_type1 o, const string& in)
{
char *s = new char[in.size() * 2 + 1];
- mysql_escape_string(s, in.c_str(), (unsigned long)in.size());
+ mysql_escape_string(s, in.c_str(), static_cast <unsigned long> (in.size()));
*o.ostr << "'" << s << "'";
delete[] s;
return *o.ostr;
@@ -60,7 +60,7 @@
{
if (in.escape_q()) {
char *s = new char[in.size() * 2 + 1];
- mysql_escape_string(s, in.c_str(), (unsigned long)in.size());
+ mysql_escape_string(s, in.c_str(), static_cast <unsigned long> (in.size()));
if (in.quote_q())
*o.ostr << "'" << s << "'";
else
@@ -97,7 +97,7 @@

if (in.escape_q()) {
char *s = new char[in.size() * 2 + 1];
- mysql_escape_string(s, in.c_str(), (unsigned long)in.size());
+ mysql_escape_string(s, in.c_str(), static_cast <unsigned long> (in.size()));
if (in.quote_q())
o << "'" << s << "'";
else
@@ -148,7 +148,7 @@
}
if (in.escape_q()) {
char *s = new char[in.size() * 2 + 1];
- mysql_escape_string(s, in.c_str(), (unsigned long)in.size());
+ mysql_escape_string(s, in.c_str(), static_cast <unsigned long> (in.size()));
if (in.quote_q())
static_cast<ostream &>(o) << "'" << s << "'";
else
@@ -283,7 +283,7 @@
}
else {
char *s = new char[in.size() * 2 + 1];
- mysql_escape_string(s, in.c_str(), (unsigned long)in.size());
+ mysql_escape_string(s, in.c_str(), static_cast <unsigned long> (in.size()));
SQLString in2 = s;
in2.processed = true;
*p.qparms << in2;
@@ -301,7 +301,7 @@
ostream& operator<<(escape_type1 o, const string& in)
{
char *s = new char[in.size() * 2 + 1];
- mysql_escape_string(s, in.c_str(), (unsigned long)in.size());
+ mysql_escape_string(s, in.c_str(), static_cast <unsigned long> (in.size()));
*o.ostr << s;
delete[] s;
return *o.ostr;
@@ -325,7 +325,7 @@
{
if (in.escape_q()) {
char *s = new char[in.size() * 2 + 1];
- mysql_escape_string(s, in.c_str(), (unsigned long)in.size());
+ mysql_escape_string(s, in.c_str(), static_cast <unsigned long> (in.size()));
delete[] s;
}
else {

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
Warren Young
 
Posts: n/a

Default Re: [PATCH] gcc 4.0.0 fixes - 05-05-2005 , 06:19 AM






Chris Frey wrote:

Quote:
- some virtual destructors for classes that have virtual functions.
I'm pretty sure this will break the ABI, so I'm going to have to hold
off on that change. Other than that, I've added your patch. Thanks.

One of the reasons I'm looking at moving to a public repository is so we
can fork off v1.8 or v2.0[*]. It will go through a period where I
don't want to release it formally, but it will still need wide testing.
I hope by having it in a public repository, some people will start
using the repository version while v1.7 is frozen and provide that testing.
[*] The question of which version it becomes has to do with how many of
the planned ABI breakages make it into the first release.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
Chris Frey
 
Posts: n/a

Default Re: [PATCH] gcc 4.0.0 fixes - 05-06-2005 , 02:12 PM



On Thu, May 05, 2005 at 05:19:25AM -0600, Warren Young wrote:
Quote:
Chris Frey wrote:

- some virtual destructors for classes that have virtual functions.

I'm pretty sure this will break the ABI, so I'm going to have to hold
off on that change. Other than that, I've added your patch. Thanks.
Cool, thanks.

Quote:
One of the reasons I'm looking at moving to a public repository is so we
can fork off v1.8 or v2.0[*]. It will go through a period where I
don't want to release it formally, but it will still need wide testing.
I hope by having it in a public repository, some people will start
using the repository version while v1.7 is frozen and provide that testing.
Unless you're planning to give people write access to the repository,
it's not strictly necessary to have a public one. Just make regular
releases of the dev tarballs.

A public repository would be handy for checking diffs though from old
versions. You just don't need it first. :-)

- Chris


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.