WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
214441
Fix -Wformat= warnings when passing enum to integer specifiers
https://bugs.webkit.org/show_bug.cgi?id=214441
Summary
Fix -Wformat= warnings when passing enum to integer specifiers
Lauro Moura
Reported
2020-07-16 20:00:16 PDT
Fix -Wformat= warnings when passing enum to integer specifiers
Attachments
Patch
(3.78 KB, patch)
2020-07-16 20:02 PDT
,
Lauro Moura
no flags
Details
Formatted Diff
Diff
Patch using uint8_t as underlying type
(5.31 KB, patch)
2020-07-16 21:31 PDT
,
Lauro Moura
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Lauro Moura
Comment 1
2020-07-16 20:02:40 PDT
Created
attachment 404524
[details]
Patch
Darin Adler
Comment 2
2020-07-16 20:48:19 PDT
Comment on
attachment 404524
[details]
Patch Those all look good. But I wonder if we could use a specific integer type as underlying type for the enumeration instead.
Lauro Moura
Comment 3
2020-07-16 21:31:39 PDT
Created
attachment 404535
[details]
Patch using uint8_t as underlying type The fast/mediastream tests worked as expected here with both enums (WebCore::MediaConstraintType and WebCore::MediaConstraint::DataType) using uint8_t as underlying type, but I'm not sure if there is any uncovered case where it could be an issue.
Darin Adler
Comment 4
2020-07-17 14:01:52 PDT
Comment on
attachment 404535
[details]
Patch using uint8_t as underlying type Seems OK. Awkward to have to write static_cast<int> out each time. Would have thought that an underlying type would help, and there would be some simple format string we could use, but not really sure how that all works with integer type promotion and all the PRIxx stuff.
Lauro Moura
Comment 5
2020-07-17 14:15:08 PDT
Comment on
attachment 404535
[details]
Patch using uint8_t as underlying type I also thought it would end up not needing the casts but both clang and GCC complained. Thanks for the review. (Regarding the red bubbles, other builds from the same time also failed in the same tests)
EWS
Comment 6
2020-07-17 14:28:48 PDT
Committed
r264534
: <
https://trac.webkit.org/changeset/264534
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 404535
[details]
.
Radar WebKit Bug Importer
Comment 7
2020-07-17 14:29:41 PDT
<
rdar://problem/65744259
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug