Bug 207478

Summary: a lot gcc warnings because of %{public}s format specifier
Product: WebKit Reporter: Víctor M. Jáquez L. <vjaquez>
Component: Web Template FrameworkAssignee: Víctor M. Jáquez L. <vjaquez>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, benjamin, bfulgham, cdumez, cmarcelo, commit-queue, darin, dbates, eric.carlson, ews-watchlist, glenn, hta, japhet, jer.noble, krollin, mjs, philipj, sergio, thorton, tommyw, webkit-bug-importer, wilander
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=225137
Attachments:
Description Flags
Patch
none
Patch none

Víctor M. Jáquez L.
Reported 2020-02-10 10:24:08 PST
While compiling with GCC a lot of big warnings are shown because those macros boil down to vfprintf() in Linux, and that {public} specifier is invalid. It is only for os_log [1] 1. https://developer.apple.com/documentation/os/logging?language=objc
Attachments
Patch (43.41 KB, patch)
2020-02-10 10:40 PST, Víctor M. Jáquez L.
no flags
Patch (44.17 KB, patch)
2020-02-12 03:49 PST, Víctor M. Jáquez L.
no flags
Víctor M. Jáquez L.
Comment 1 2020-02-10 10:40:08 PST
Darin Adler
Comment 2 2020-02-11 13:01:20 PST
Comment on attachment 390262 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=390262&action=review > Source/WTF/wtf/Assertions.h:487 > +#define LOGDSTR "s" In WebKit coding style we normally prefer words over clumps of letters. I don’t know that LOGDSTR is a good choice for the project. Is this referring to something named "logd"? Maybe PUBLIC_LOG_STRING would be a good name? Also, why not put the "%" into the macro?
Keith Rollin
Comment 3 2020-02-11 13:31:04 PST
(In reply to Darin Adler from comment #2) > Also, why not put the "%" into the macro? I think that leaving the "%" out of the macro follows standard macros like PRId64. Any naming convention should take into account other types of format specifications that might be used. For instance: PUBLIC_LOG_STRING: {public}s PRIVATE_LOG_STRING: {private}s FUTUREOPTION_LOG_STRING: {future-option}s PUBLIC_LOG_OBJCOBJECT: {public}@ PRIVATE_LOG_OBJCOBJECT: {private}@ FUTUREOPTION_LOG_OBJCOBJECT: {future-option}@ So while I like LOGDSTR for its brevity, it doesn't scale.
Darin Adler
Comment 4 2020-02-11 16:08:35 PST
(In reply to Keith Rollin from comment #3) > (In reply to Darin Adler from comment #2) > > Also, why not put the "%" into the macro? > > I think that leaving the "%" out of the macro follows standard macros like > PRId64. It does. That alone doesn’t seem like reason to follow suit, though.
Keith Rollin
Comment 5 2020-02-11 19:05:19 PST
(In reply to Darin Adler from comment #4) > (In reply to Keith Rollin from comment #3) > > (In reply to Darin Adler from comment #2) > > > Also, why not put the "%" into the macro? > > > > I think that leaving the "%" out of the macro follows standard macros like > > PRId64. > > It does. That alone doesn’t seem like reason to follow suit, though. What's the reason for not following suit? Personally, I'd like to be consistent with the standard. That way I don't have to remember "OK, add the % for the standard macros, but leave it out for WebKit macros. Or is it the other way around...".
Víctor M. Jáquez L.
Comment 6 2020-02-12 02:25:45 PST
(In reply to Keith Rollin from comment #5) > (In reply to Darin Adler from comment #4) > > (In reply to Keith Rollin from comment #3) > > > (In reply to Darin Adler from comment #2) > > > > Also, why not put the "%" into the macro? > > > > > > I think that leaving the "%" out of the macro follows standard macros like > > > PRId64. > > > > It does. That alone doesn’t seem like reason to follow suit, though. > > What's the reason for not following suit? > > Personally, I'd like to be consistent with the standard. That way I don't > have to remember "OK, add the % for the standard macros, but leave it out > for WebKit macros. Or is it the other way around...". I do agree. It is better, IMO, to be consistent with other formatting macros.
Víctor M. Jáquez L.
Comment 7 2020-02-12 03:49:26 PST
Víctor M. Jáquez L.
Comment 8 2020-02-12 03:51:58 PST
(In reply to Keith Rollin from comment #3) > (In reply to Darin Adler from comment #2) > > Also, why not put the "%" into the macro? > > I think that leaving the "%" out of the macro follows standard macros like > PRId64. > > Any naming convention should take into account other types of format > specifications that might be used. For instance: > > PUBLIC_LOG_STRING: {public}s Done. Now this symbol is used. > PRIVATE_LOG_STRING: {private}s > FUTUREOPTION_LOG_STRING: {future-option}s > > PUBLIC_LOG_OBJCOBJECT: {public}@ > PRIVATE_LOG_OBJCOBJECT: {private}@ > FUTUREOPTION_LOG_OBJCOBJECT: {future-option}@ > > So while I like LOGDSTR for its brevity, it doesn't scale.
Darin Adler
Comment 9 2020-02-12 15:58:34 PST
(In reply to Keith Rollin from comment #5) > What's the reason for not following suit? To me PUBLIC_LOG_STRING doesn’t seem much like PRId64. I agree that if you thought of them as similar and closely related then we’d want them to match. > Personally, I'd like to be consistent with the standard. That way I don't > have to remember "OK, add the % for the standard macros, but leave it out > for WebKit macros. Or is it the other way around...". OK, tastes differ, and I certainly won’t insist.
Víctor M. Jáquez L.
Comment 10 2020-02-17 05:26:59 PST
May I have r+ & q+ ? O:)
WebKit Commit Bot
Comment 11 2020-02-17 10:48:04 PST
Comment on attachment 390505 [details] Patch Clearing flags on attachment: 390505 Committed r256745: <https://trac.webkit.org/changeset/256745>
WebKit Commit Bot
Comment 12 2020-02-17 10:48:06 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 13 2020-02-17 10:49:14 PST
Note You need to log in before you can comment on or make changes to this bug.