Bug 188919

Summary: [FreeType] Do not cast through GLib types in FontCustomPlatformDataFreeType.cpp
Product: WebKit Reporter: Adrian Perez <aperez>
Component: WebKit Misc.Assignee: Adrian Perez <aperez>
Status: RESOLVED FIXED    
Severity: Normal CC: clopez, commit-queue, dino, don.olmstead, mcatanzaro, mmaxfield, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Adrian Perez 2018-08-24 06:10:46 PDT
As por Don's comment in bug #185462 (comment 8)

> Noticed this issue while rebasing. GCallback shouldn't be in freetype files.
>
> > Source/WebCore/platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:51
> > +        reinterpret_cast<cairo_destroy_func_t>(reinterpret_cast<GCallback>(FT_Done_Face)));
>
> This casts assumes USE(GLIB)
Comment 1 Adrian Perez 2018-08-24 06:13:00 PDT
Created attachment 348003 [details]
Patch
Comment 2 Michael Catanzaro 2018-08-24 06:49:50 PDT
Comment on attachment 348003 [details]
Patch

The double cast is probably needed to silence -Wcast-function-type. Are you certain this doesn't introduce any new warnings when building with GCC 8?

Instead of casting through GCallback, you can instead cast through void (*) (void). That's the documented way to avoid -Wcast-function-type. GCallback is just a typedef for that.
Comment 3 Michael Catanzaro 2018-08-24 06:52:44 PDT
Comment on attachment 348003 [details]
Patch

This blames to r231565

So you'll need to use void (*) (void) instead.
Comment 4 Adrian Perez 2018-08-24 07:13:18 PDT
Created attachment 348005 [details]
Patch
Comment 5 Don Olmstead 2018-08-24 09:08:09 PDT
Clang is happy with the change. So informally I would r+ this as long as GCC is happy.
Comment 6 WebKit Commit Bot 2018-08-24 12:13:09 PDT
Comment on attachment 348005 [details]
Patch

Clearing flags on attachment: 348005

Committed r235325: <https://trac.webkit.org/changeset/235325>
Comment 7 WebKit Commit Bot 2018-08-24 12:13:11 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2018-08-24 12:14:22 PDT
<rdar://problem/43693002>