Bug 206238 - [WTF] Remove MediaTime.cpp test warning in GCC
Summary: [WTF] Remove MediaTime.cpp test warning in GCC
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alicia Boya García
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-01-14 09:02 PST by Alicia Boya García
Modified: 2020-01-15 03:46 PST (History)
4 users (show)

See Also:


Attachments
Patch (1.46 KB, patch)
2020-01-14 09:05 PST, Alicia Boya García
no flags Details | Formatted Diff | Diff
Patch (1.47 KB, patch)
2020-01-14 10:15 PST, Alicia Boya García
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alicia Boya García 2020-01-14 09:02:27 PST
GCC emits warnings when it finds clang pragmas, so I'm wrapping them
in #ifdef __clang__ to reduce the noise.
Comment 1 Alicia Boya García 2020-01-14 09:05:31 PST
Created attachment 387662 [details]
Patch
Comment 2 Charlie Turner 2020-01-14 09:35:07 PST
I think the macros in Compiler.h (IGNORE_*) should be used/modified for these sorts of checks, they have logic to check for compiler support and probably other gotchas.
Comment 3 Alicia Boya García 2020-01-14 10:11:58 PST
(In reply to Charlie Turner from comment #2)
> I think the macros in Compiler.h (IGNORE_*) should be used/modified for
> these sorts of checks, they have logic to check for compiler support and
> probably other gotchas.

Thing is, these macros are made to ignore warnings in certain compilers. This code on the other hand is intended to turn a specific, disabled by default warning, into an error in clang. This specific warning is also only supported by clang.

And since that code uses clang pragmas, GCC shows a warning, which now I'm trying to avoid.

From a glance at Compiler.h I don't see how they could be used for this case.

I could use `#if COMPILER(clang)` instead of `#ifdef __clang__` though.
Comment 4 Alicia Boya García 2020-01-14 10:15:09 PST
Created attachment 387671 [details]
Patch
Comment 5 WebKit Commit Bot 2020-01-15 03:45:55 PST
Comment on attachment 387671 [details]
Patch

Clearing flags on attachment: 387671

Committed r254563: <https://trac.webkit.org/changeset/254563>
Comment 6 WebKit Commit Bot 2020-01-15 03:45:56 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2020-01-15 03:46:21 PST
<rdar://problem/58601295>