Closed Bug 1118529 Opened 6 years ago Closed 6 years ago

Remove MSIntTypes.h

Categories

(Core :: MFBT, defect)

All
Windows 8
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla37

People

(Reporter: cpeterson, Assigned: cpeterson)

References

Details

Attachments

(1 file)

Bug 1117820 removed support for MSVC 2012, so we should be able to remove MSIntTypes.h because MSVC 2013's standard library includes a real inttypes.h.
We can probably remove MOZ_CUSTOM_INTTYPES_H, too.
Don't forget to remove it from toolkit/content/license.html too.

(In reply to Chris Peterson [:cpeterson] from comment #1)
> We can probably remove MOZ_CUSTOM_INTTYPES_H, too.

See bug 730805 comment 8 for context as to why it's there. Check with Waldo if we still want to keep this.
And from that, "There's no intrinsic value to enabling overriding -- we just do it because we have to."  So this seems reasonable.  A shame we can't get rid of IntegerPrintfMacros.h entirely, but I guess as long as there are format warnings in some <inttypes.h> we don't have much choice.
Remove MSIntTypes.h, MOZ_CUSTOM_INTTYPES_H, and msinttypes license.

Green Try build:
https://tbpl.mozilla.org/?tree=Try&rev=dc086969461e
Assignee: nobody → cpeterson
Status: NEW → ASSIGNED
Attachment #8545105 - Flags: review?(jwalden+bmo)
Comment on attachment 8545105 [details] [diff] [review]
remove-MSIntTypes.patch

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

::: mfbt/IntegerPrintfMacros.h
@@ +5,3 @@
>   * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
>  
>  /* Implements the C99 <inttypes.h> interface, minus the SCN* format macros. */

Now that we're using <inttypes.h> everywhere, this latter bit about the SCN* macros is wrong.  Remove everything after "interface" here.

@@ +15,5 @@
>   * (specifically, to implement scanning into an 8-bit location).
>   *
>   * http://stackoverflow.com/questions/3036396/scanfd-char-char-as-int-format-string
>   *
>   * Moreover, scanf is a footgun: if the input number exceeds the bounds of the

This comment is rather dated with this change, because we do provide SCN* macros, always.  Change it to this:

/*
 * 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!
 */
Attachment #8545105 - Flags: review?(jwalden+bmo) → review+
https://hg.mozilla.org/mozilla-central/rev/0494ce969472
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in before you can comment on or make changes to this bug.