Opened 11 years ago

Closed 11 years ago

#5936 closed Bugs (duplicate)

Missing prototype for pthread_mutex_timedlock causes Oracle/SUN CC to fail on Linux

Reported by: Peter Loibl <boost@…> Owned by: viboes
Milestone: To Be Determined Component: thread
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc: viboes

Description

CC: Sun C++ 5.11 Linux_i386 2010/08/13 usage: CC [ options ] files. Use 'CC -flags' for details

"./boost/thread/pthread/mutex.hpp", line 154: Error: The function "pthread_mutex_timedlock" must have a prototype.

"./boost/thread/pthread/mutex.hpp", line 154: Error: The function "pthread_mutex_timedlock" must have a prototype.

"/usr/include/linux/kernel.h", line 26: Error: An array cannot have zero size unless you use the option -features=zla. 3 Error(s) detected.

"CC" -library=stlport4 -xO4 -mt -erroff=%none -m64 -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_POSIX -DNDEBUG -I"." -c -o "/home/pal/work/cpp/tmp/boost/bin.v2/libs/thread/build/sun/release/address-model-64/link-static/stdlib-sun-stlport/threading-multi/pthread/thread.o" "libs/thread/src/pthread/thread.cpp"

...failed sun.compile.c++ /home/pal/work/cpp/tmp/boost/bin.v2/libs/thread/build/sun/release/address-model-64/link-static/stdlib-sun-stlport/threading-multi/pthread/thread.o...

Attachments (1)

warning.out (60.8 KB ) - added by Peter Loibl <boost@…> 11 years ago.

Download all attachments as: .zip

Change History (4)

in reply to:  description comment:1 by Peter Loibl <boost@…>, 11 years ago

It seems that CC does not use -D_GNU_SOURCE (see ticket #5937). If I call CC and add -D_GNU_SOURCE manually, then the source file complies without an error, but generates a rather huge warning (see attached file).

by Peter Loibl <boost@…>, 11 years ago

Attachment: warning.out added

comment:2 by viboes, 11 years ago

Cc: viboes added
Owner: changed from Anthony Williams to viboes
Status: newassigned

I don't know I understand correctly.

Could you send the file where pthread_mutex_timedlock is defined?

It is up to the user to add the -D_GNU_SOURCE manually in your configuration? If yes, which of the warnings are related to Boost.Thread?

comment:3 by viboes, 11 years ago

Resolution: duplicate
Status: assignedclosed

Duplicate of #3639 Boost.Thread doesn't build with Sun-5.9 on Linux

Note: See TracTickets for help on using tickets.