Bug 1186126 - Note incompatibility with NSPR printf-like functions. r=nfroyd
authorOliver Henshaw <oliver.henshaw@gmail.com>
Mon, 27 Jul 2015 10:08:00 +0200
changeset 254930 df688ddb5dbec61e5f16f0421b2b5593a5172af9
parent 254929 54e51956cd9f1eea23db69f2b651993bf594c441
child 254931 992a26539e878a5b2dff7d33d30c4dbb1f85b836
push id29124
push userryanvm@gmail.com
push dateTue, 28 Jul 2015 18:36:51 +0000
treeherdermozilla-central@42521959e9b9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnfroyd
bugs1186126
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1186126 - Note incompatibility with NSPR printf-like functions. r=nfroyd printf-like functions
mfbt/IntegerPrintfMacros.h
--- a/mfbt/IntegerPrintfMacros.h
+++ b/mfbt/IntegerPrintfMacros.h
@@ -5,16 +5,22 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Implements the C99 <inttypes.h> interface. */
 
 #ifndef mozilla_IntegerPrintfMacros_h_
 #define mozilla_IntegerPrintfMacros_h_
 
 /*
+ * These macros should not be used with the NSPR printf-like functions or their
+ * users, e.g. mozilla/Logging.h.  If you need to use NSPR's facilities, see the
+ * comment on supported formats at the top of nsprpub/pr/include/prprf.h.
+ */
+
+/*
  * scanf is a footgun: if the input number exceeds the bounds of the target
  * type, behavior is undefined (in the compiler sense: that is, this code
  * could overwrite your hard drive with zeroes):
  *
  *   uint8_t u;
  *   sscanf("256", "%" SCNu8, &u); // BAD
  *
  * For this reason, *never* use the SCN* macros provided by this header!