Opened 14 years ago

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

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 12 years ago.
inline forward declaration

Download all attachments as: .zip

Change History (6)

comment:1 by Jonathan Wakely <jwakely.boost@…>, 13 years ago

Cc: jwakely.boost@… added

what version of GCC are you uing?

comment:2 by anonymous, 13 years ago

4.3.3

comment:3 by viboes, 13 years ago

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();

by viboes, 12 years ago

Attachment: 2747.patch added

inline forward declaration

comment:4 by viboes, 12 years ago

Type: BugsPatches

comment:5 by Anthony Williams, 12 years ago

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.

Note: See TracTickets for help on using tickets.