On 03/05/07, Jason Ellis <jason@stripped> wrote:
> I am trying to incorporate mysql++ into an existing project and I have been
> able to get it to compile, however when I include the mysql++.h header file
> I get the following warnings when I compile:
>
> /usr/local/include/mysql++/lockable.h: In constructor
> 'mysqlpp::BasicLock::BasicLock(bool)':
> /usr/local/include/mysql++/lockable.h:82: warning: declaration of 'locked'
> shadows a member of 'this'
> /usr/local/include/mysql++/lockable.h: In constructor
> 'mysqlpp::Lockable::Lockable(bool)':
> /usr/local/include/mysql++/lockable.h:125: warning: declaration of 'locked'
> shadows a member of 'this'
>
> This happens even if I am not using anything from the mysql++ library. I
> was just wondering if anyone had any suggestions on how to get rid of the
> warning.
The warning's harmless, but so is preventing it so probably worth doing.
I can't remember if gcc's -Wno-shadow will suppress the warning, it might do.
The best way is to rename either the BasicLock constructor parameter,
or the BasicLock::locked() member function. The obvious choice that
won't break ABI is to rename the constructor parameter to is_locked,
or initially_locked. Same goes for the Lockable constructor
parameter.
Jon

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.