Closed Bug 1006986 Opened 6 years ago Closed 6 years ago

flame debug build failed on MOZ_ASSERT_IF() in dom/bluetooth/bluez/BluetoothDBusService.cpp

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

x86
macOS
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
2.0 S1 (9may)

People

(Reporter: TYLin, Assigned: TYLin)

Details

Attachments

(1 file)

I build flame debug on Mac OS X 10.9. The error message is as follows:

BluetoothDBusService.o
../../../gecko/dom/bluetooth/bluez/BluetoothDBusService.cpp: In member function 'virtual void mozilla::dom::bluetooth::BluetoothDBusService::SendMetaData(const nsAString_internal&, const nsAString_internal&, const nsAString_internal&, int64_t, int64_t, int64_t, mozilla::dom::bluetooth::BluetoothReplyRunnable*)':
../../../gecko/dom/bluetooth/bluez/BluetoothDBusService.cpp:3892:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
In file included from ../../../gecko/ipc/chromium/src/base/basictypes.h:14:0,
                 from ../../../gecko/dom/bluetooth/bluez/BluetoothDBusService.cpp:19:
../../dist/include/mozilla/Assertions.h: In instantiation of 'void mozilla::detail::ValidateAssertConditionType() [with T = const char (&)[26]]':
../../../gecko/dom/bluetooth/bluez/BluetoothDBusService.cpp:1114:129:   required from here
../../dist/include/mozilla/Assertions.h:322:3: error: static assertion failed: Expected boolean assertion condition, got an array or a string!
Attachment #8418540 - Flags: review?(echou)
Assignee: shuang → tlin
Comment on attachment 8418540 [details] [diff] [review]
Fix build fail for flame debug.

Review of attachment 8418540 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks, Ting-Yu!
Attachment #8418540 - Flags: review?(echou) → review+
Comment on attachment 8418540 [details] [diff] [review]
Fix build fail for flame debug.

Review of attachment 8418540 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/bluetooth/bluez/BluetoothDBusService.cpp
@@ +1110,5 @@
>          parameters.AppendElement(properties[i]);
>          break;
>        }
>      }
> +    MOZ_ASSERT(i != properties.Length(), "failed to get device name");

You are inverting the condition.
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #3)
> Comment on attachment 8418540 [details] [diff] [review]
> Fix build fail for flame debug.
> 
> Review of attachment 8418540 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: dom/bluetooth/bluez/BluetoothDBusService.cpp
> @@ +1110,5 @@
> >          parameters.AppendElement(properties[i]);
> >          break;
> >        }
> >      }
> > +    MOZ_ASSERT(i != properties.Length(), "failed to get device name");
> 
> You are inverting the condition.

Oh, I just saw the difference. Never mind. :)
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #4)
> (In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #3)
> > Comment on attachment 8418540 [details] [diff] [review]
> > Fix build fail for flame debug.
> > 
> > Review of attachment 8418540 [details] [diff] [review]:
> > -----------------------------------------------------------------
> > 
> > ::: dom/bluetooth/bluez/BluetoothDBusService.cpp
> > @@ +1110,5 @@
> > >          parameters.AppendElement(properties[i]);
> > >          break;
> > >        }
> > >      }
> > > +    MOZ_ASSERT(i != properties.Length(), "failed to get device name");
> > 
> > You are inverting the condition.
> 
> Oh, I just saw the difference. Never mind. :)

I was really surprised at how long the original MOZ_ASSERT_IF exists in our codebase. :-|
And ASSERT_IF is such a bad name, because 'assert' means to me 'expect something to be true', not 'warn and abort'. Good to see this gone. :D
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/a0840fbb59fd
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.0 S1 (9may)
You need to log in before you can comment on or make changes to this bug.