Bug 211784 - -Wattribute warning in BreakLines.cpp
Summary: -Wattribute warning in BreakLines.cpp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-05-12 09:37 PDT by Michael Catanzaro
Modified: 2020-05-12 15:08 PDT (History)
9 users (show)

See Also:


Attachments
Patch (1.90 KB, patch)
2020-05-12 09:39 PDT, Michael Catanzaro
no flags Details | Formatted Diff | Diff
Patch for landing (1.85 KB, patch)
2020-05-12 14:42 PDT, Michael Catanzaro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2020-05-12 09:37:43 PDT
Looks like another new GCC 10 warning:

[625/1151] Building CXX object Source/...sources/UnifiedSource-043dd90b-1.cpp.o
In file included from DerivedSources/WebCore/unified-sources/UnifiedSource-043dd90b-1.cpp:4:
/home/mcatanzaro/Projects/WebKit/Source/WebCore/rendering/BreakLines.cpp:53:78: warning: ‘visibility’ attribute ignored [-Wattributes]
   53 | WEBCORE_EXPORT const unsigned char lineBreakTable[][lineBreakTableColumnCount] = {
      |                                                                              ^

This variable does not seem to be used outside WebCore, so let's try removing it and see if EWS is happy.
Comment 1 Michael Catanzaro 2020-05-12 09:39:29 PDT
Created attachment 399135 [details]
Patch
Comment 2 Darin Adler 2020-05-12 10:55:07 PDT
Comment on attachment 399135 [details]
Patch

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

> Source/WebCore/ChangeLog:8
> +        Don't export lineBreakTable. It's not used outside WebCore anyway.

This comment is not accurate; it’s not what is done by this patch. Removing the WEBCORE_EXPORT from the definition does not change whether lineBreakTable is exported. That’s decided by the WEBCORE_EXPORT on the declaration in the header.

I don’t know if lineBreakTable is used outside WebCore; to find out we’d have to check on the callers of all the WebCore inline functions that use lineBreakTable. If any of them are called outside WebCore, then it *is* used outside.

If we wanted to not export it, then we’d have to remove the WEBCORE_EXPORT from the header.

Removing this export from the .cpp file does seem like an acceptable way to fix the warning, so r=me on the code change, but please change this change log comment.
Comment 3 Michael Catanzaro 2020-05-12 14:03:08 PDT
You're right!

Learning is good....
Comment 4 Michael Catanzaro 2020-05-12 14:42:00 PDT
Created attachment 399180 [details]
Patch for landing
Comment 5 EWS 2020-05-12 15:07:30 PDT
Committed r261580: <https://trac.webkit.org/changeset/261580>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 399180 [details].
Comment 6 Radar WebKit Bug Importer 2020-05-12 15:08:21 PDT
<rdar://problem/63156143>