gecko-dev/netwerk
Nicholas Nethercote 34dcc7b852 Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm.
This change avoids lots of false positives for Coverity's CHECKED_RETURN
warning, caused by NS_WARN_IF's current use in both statement-style and
expression-style.

In the case where the code within the NS_WARN_IF has side-effects, I made the
following change.

> NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));
> -->
> Unused << NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));

In the case where the code within the NS_WARN_IF lacks side-effects, I made the
following change.

> NS_WARN_IF(!condWithoutSideEffects);
> -->
> NS_WARNING_ASSERTION(condWithoutSideEffects, "msg");

This has two improvements.
- The condition is not evaluated in non-debug builds.
- The sense of the condition is inverted to the familiar "this condition should
  be true" sense used in assertions.

A common variation on the side-effect-free case is the following.

> nsresult rv = Fn();
> NS_WARN_IF_(NS_FAILED(rv));
> -->
> DebugOnly<nsresult rv> = Fn();
> NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Fn failed");

--HG--
extra : rebase_source : 58788245021096efa8372a9dc1d597a611d45611
2016-09-02 17:12:24 +10:00
..
base Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm. 2016-09-02 17:12:24 +10:00
build Bug 1244227 - Add nsIThrottledInputChannel.idl and implement. r=mcmanus 2016-08-23 07:36:52 -06:00
cache Bug 1297658 - Avoid unnecessary checking in memory reporters. r=erahm. 2016-08-24 15:23:45 +10:00
cache2 Bug 1277826 - Crash in shutdownhang | mozilla::net::CacheIndex::WriteLogToDisk, r=honzab 2016-09-04 02:39:49 +02:00
cookie Backed out changeset 2ecd402d3934 (bug 1264192) for frequent failure in netwerk/cookie/test/unit/test_eviction.js. r=backout 2016-09-04 15:07:24 +02:00
dns Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm. 2016-09-02 17:12:24 +10:00
ipc Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm. 2016-09-02 17:12:24 +10:00
locales Bug 1289135 - Fix typos in the properties files r=Ehsan 2016-07-25 16:34:38 +02:00
mime Bug 1195723: [flac] P10. Add media sniffer for flac file. r=kamidphish 2016-08-17 15:47:39 +10:00
protocol Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm. 2016-09-02 17:12:24 +10:00
sctp Bug 1299727 - Rename NS_WARN_IF_FALSE as NS_WARNING_ASSERTION. r=erahm. 2016-09-01 15:01:16 +10:00
socket Bug 1297276 - Fix another instance of mozilla/unused.h that snuck in. 2016-08-25 09:31:35 -04:00
srtp Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
standalone Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
streamconv Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm. 2016-09-02 17:12:24 +10:00
system Bug 1292323 - Update WrapForJNI usages; r=snorp 2016-08-12 23:15:52 -04:00
test Bug 1297961 (part 1) - Introduce nsURI::GetSpecOrDefault(). r=hurley. 2016-08-26 16:02:31 +10:00
wifi Bug 1296176 - Replace PR_MIN with std::min in netwerk. r=jesup,mcmanus 2016-08-22 14:37:42 -07:00
moz.build Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
necko-config.h.in