Patches item #796776, was opened at 2003-08-28 16:39
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=307869&aid=796776&group_id=7869
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jonathan Wakely (redi)
Assigned to: Nobody/Anonymous (nobody)
Summary: Prevent warnings about unitialised bases
Initial Comment:
Compiling with GCC 3.4 with -Wall and -W produces the
following warnings:
Query.cc: In copy constructor
`mysqlcppapi::Query::Query(const mysqlcppapi::Query&)':
Query.cc:16: warning: base class `struct
std::basic_ios<char, std::char_traits<char> >' should
be explicitly initialized in the copy constructor
and
sql_query.cc: In copy constructor
`mysqlcppapi::SQLQuery::SQLQuery(const
mysqlcppapi::SQLQuery&)':
sql_query.cc:13: warning: base class `struct
std::basic_ios<char, std::char_traits<char> >' should
be explicitly initialized in the copy constructor
sql_query.cc:13: warning: base class `struct
std::basic_stringstream<char, std::char_traits<char>,
std::allocator<char> >' should be explicitly
initialized in the copy constructor
This patch explicitly initialises the relevant base
classes to remove the warnings. (Both Query and
SQLQuery have to initialise std::ios because it's a
virtual base and the most derived class in a hierarchy
must initialise virtual bases).
N.B. as commented in the files, it is safe to default
contruct std::ios because the std::stringstream object
will call std::ios::init() with it's stringbuf as the
argument. Otherwise it would not be safe to destroy the
std::ios object.
The patch also moves a couple of assignments in the
ctor bodies into initiallisation lists.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=307869&aid=796776&group_id=7869
|