Opened 9 years ago

Closed 7 years ago

#2747 closed Patches (fixed)

inline warning

Reported by: Yang Zhang <yang.boostbugs@…> Owned by: Anthony Williams
Milestone: Boost 1.39.0 Component: thread
Version: Boost Development Trunk Severity: Problem
Keywords: Cc: jwakely.boost@…


farm6 1234338979.38 :   cc1plus: warnings being treated as errors
farm6 1234338979.38 :   In file included from /u/yang/.local/armed/include/boost/thread/condition_variable.hpp:16,
farm6 1234338979.38 :                    from /u/yang/.local/armed/include/boost/thread.hpp:14,
farm6 1234338979.38 :                    from main.lzz:13,
farm6 1234338979.38 :                    from
farm6 1234338979.38 :   /u/yang/.local/armed/include/boost/thread/pthread/condition_variable.hpp:23: error: ‘bool boost::condition_variable::timed_wait(boost::unique_lock<boost::mutex>&, const boost::system_time&)’ was used before it was declared inline
farm6 1234338979.38 :   /u/yang/.local/armed/include/boost/thread/pthread/condition_variable_fwd.hpp:49: error: previous non-inline declaration here

Attachments (1)

2747.patch (590 bytes) - added by viboes 7 years ago.
inline forward declaration

Download all attachments as: .zip

Change History (6)

comment:1 Changed 8 years ago by Jonathan Wakely <jwakely.boost@…>

Cc: jwakely.boost@… added

what version of GCC are you uing?

comment:2 Changed 8 years ago by anonymous


comment:3 Changed 8 years ago by viboes

In order to respect C++ conformance the inline declaration should be at the declaration, so we should have the following declarations in boost/thread/pthread/condition_variable_fwd.hpp

  inline void wait(unique_lock<mutex>& m);

  inline bool timed_wait(unique_lock<mutex>& m,boost::system_time const& wait_until);

  inline void notify_one();
  inline void notify_all();

Changed 7 years ago by viboes

Attachment: 2747.patch added

inline forward declaration

comment:4 Changed 7 years ago by viboes

Type: BugsPatches

comment:5 Changed 7 years ago by Anthony Williams

Resolution: fixed
Status: newclosed

The problem is due to the use of this overload of timed_wait in the xtime overload, which causes a gcc warning (it is not a conformance issue).

Thanks for the patch.

Fixed on trunk.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Anthony Williams.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.