Bug 96682 - Add a style guide rule for signed and unsigned int
Summary: Add a style guide rule for signed and unsigned int
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-13 12:26 PDT by Ryosuke Niwa
Modified: 2012-09-13 13:56 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.42 KB, patch)
2012-09-13 12:27 PDT, Ryosuke Niwa
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2012-09-13 12:26:30 PDT
Add a style guide rule for signed and unsigned int
Comment 1 Ryosuke Niwa 2012-09-13 12:27:32 PDT
Created attachment 163935 [details]
Patch
Comment 2 Geoffrey Garen 2012-09-13 12:49:43 PDT
Comment on attachment 163935 [details]
Patch

r=me
Comment 3 Ryosuke Niwa 2012-09-13 13:17:09 PDT
Committed r128499: <http://trac.webkit.org/changeset/128499>
Comment 4 Darin Adler 2012-09-13 13:31:32 PDT
Comment on attachment 163935 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=163935&action=review

> Websites/webkit.org/coding/coding-style.html:1065
> +signed b; // Uses "singed" instead of "int".

Typo: singed
Comment 5 Ryosuke Niwa 2012-09-13 13:49:29 PDT
Fixed the typo in r128503.
Comment 6 Daniel Bates 2012-09-13 13:55:33 PDT
Comment on attachment 163935 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=163935&action=review

> Websites/webkit.org/coding/coding-style.html:1055
> +Omit "int" when using "unsigned" modifier. Do not use "signed" modifier. Use "int" by itself instead.

We should be explicit about not using the "signed" modifier for integer types. This part of the rule shouldn't be applied to objects of type char used in a bit-fields by bug 54807 comment 9 (*).

(*) For completeness, Final Committee Draft of "ISO/IEC IS 14882 – Programming Languages – C++" (28 February 2011) is at <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf>. Bug 54807 comment 9 references an incorrect URL that was corrected in bug 54807 comment 10).
For completeness, a newer