Ticket #2747 (closed Patches: fixed)

Opened 8 years ago

Last modified 7 years ago

inline warning

Reported by: Yang Zhang <yang.boostbugs@…> Owned by: anthonyw
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


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

Change History

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 7 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

inline forward declaration

comment:4 Changed 7 years ago by viboes

  • Type changed from Bugs to Patches

comment:5 Changed 7 years ago by anthonyw

  • Status changed from new to closed
  • Resolution set to fixed

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.


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

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

Note: See TracTickets for help on using tickets.