Opened 14 years ago

Closed 14 years ago

#1991 closed Bugs (duplicate)

incomplete xtime/timespec initializers

Reported by: Steven Scott <Steven.Scott@…> Owned by: Anthony Williams
Milestone: Boost 1.36.0 Component: thread
Version: Boost 1.35.0 Severity: Problem
Keywords: timespec/xtime initializer Cc:

Description

There appear to be missing initializers in the following two files:

1) boost/thread/pthread/timespec.hpp:18: warning: missing initializer for member `timespec::tv_nsec'

2) boost/thread/xtime.hpp:59: warning: missing initializer for member `boost::xtime::nsec'

In both cases a struct with two ints was initialized by {0}, which caused my compiler (cygwin gcc 3.4.4) to complain. I'm sure this was just because I have a bunch of warning flags turned on, but the fix is easy. Replacing the initializer with {0,0} fixed the problem.

Build output follows


~/BOOM2[599] scons g++ -o debug/Models/Glm/PosteriorSamplers/MLVS_data_imputer.o -c -g -Wall -Wunused -Wextra -Werror -Woverloaded-virtual -Wsign-promo -Wno-uninitialized -Isrc -I/home/sls/include/boost/tr1/tr1 -I/home/sls/include debug/Models/Glm/PosteriorSamplers/MLVS_data_imputer.cpp In file included from /home/sls/include/boost/thread/pthread/mutex.hpp:18,

from /home/sls/include/boost/thread/mutex.hpp:16, from /home/sls/include/boost/thread/pthread/thread.hpp:14, from /home/sls/include/boost/thread/thread.hpp:17, from /home/sls/include/boost/thread.hpp:12, from debug/Models/Glm/PosteriorSamplers/MLVS_data_imputer.cpp:21:

/home/sls/include/boost/thread/pthread/timespec.hpp: In function `timespec boost::detail::get_timespec(const boost::system_time&)': /home/sls/include/boost/thread/pthread/timespec.hpp:18: warning: missing initializer for member `timespec::tv_nsec' In file included from /home/sls/include/boost/thread/pthread/condition_variable_fwd.hpp:12,

from /home/sls/include/boost/thread/pthread/thread_data.hpp:14, from /home/sls/include/boost/thread/pthread/condition_variable.hpp:14, from /home/sls/include/boost/thread/condition_variable.hpp:16, from /home/sls/include/boost/thread/pthread/thread.hpp:15, from /home/sls/include/boost/thread/thread.hpp:17, from /home/sls/include/boost/thread.hpp:12, from debug/Models/Glm/PosteriorSamplers/MLVS_data_imputer.cpp:21:

/home/sls/include/boost/thread/xtime.hpp: In function `boost::xtime boost::get_xtime(const boost::system_time&)': /home/sls/include/boost/thread/xtime.hpp:59: warning: missing initializer for member `boost::xtime::nsec' scons: * [debug/Models/Glm/PosteriorSamplers/MLVS_data_imputer.o] Error 1

Change History (1)

comment:1 by Anthony Williams, 14 years ago

Resolution: duplicate
Status: newclosed

This is a duplicate of a previous issue. Already fixed on trunk.

Note: See TracTickets for help on using tickets.