Closed Bug 1378412 Opened 7 years ago Closed 7 years ago

Build error on Linux 32 bit due to a warning in task_queue_libevent.cc with clang 4.0

Categories

(Core :: WebRTC, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: ehsan.akhgari, Assigned: dminor)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

mozconfig:
export CC=clang
export CXX=clang++
export CCACHE_COMPRESS=""
export CCACHE_CPP2="yes"
export CFLAGS="-fcolor-diagnostics"
export CXXFLAGS="-fcolor-diagnostics"

. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-ff-opt32
mk_add_options AUTOCLOBBER=1

ac_add_options --enable-optimize
ac_add_options --disable-debug
ac_add_options --enable-profiling

error:
20:17.87 /moz/src.1347035/media/webrtc/trunk/webrtc/base/task_queue_libevent.cc:237:19: error: non-constant-expression cannot be narrowed from type 'unsigned int' to '__time_t' (aka 'long') in initializer list [-Wc++11-narrowing]
20:17.87     timeval tv = {milliseconds / 1000,
20:17.87                   ^~~~~~~~~~~~~~~~~~~
20:17.87 /moz/src.1347035/media/webrtc/trunk/webrtc/base/task_queue_libevent.cc:237:19: note: insert an explicit cast to silence this issue
20:17.87     timeval tv = {milliseconds / 1000,
20:17.87                   ^~~~~~~~~~~~~~~~~~~
20:17.87                   static_cast<__time_t>( )
Blocks: buildwarning
Assignee: nobody → dminor
Rank: 19
Priority: -- → P1
Attached patch Fix warning (obsolete) — Splinter Review
Fixes the warning as the compiler suggests.
Attachment #8883934 - Flags: review?(rjesup)
You probably want to cast to time_t, not __time_t (the latter is an internal compiler specific typedef AFAIK.  Also note that this is upstream code AFAIK which we may not be allowed to modify locally.
Attached patch Fix warningSplinter Review
Thanks for pointing out I had used __time_t.

We have already had to add a cast in the following line over in Bug 1375238 to fix another clang warning, so there's a precedent for fixing these.
Attachment #8883934 - Attachment is obsolete: true
Attachment #8883934 - Flags: review?(rjesup)
Attachment #8884007 - Flags: review?(rjesup)
Attachment #8884007 - Flags: review?(rjesup) → review+
Pushed by dminor@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2b3851740c1b
Fix build error on Linux 32 bit due to a warning in task_queue_libevent.cc with clang 4.0; r=jesup
https://hg.mozilla.org/mozilla-central/rev/2b3851740c1b
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: