Modify

Opened 8 years ago

Closed 7 years ago

#2747 closed Patches (fixed)

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

Description

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 main.cc:4:
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

4.3.3

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

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

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

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 Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain anthonyw.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.