Bug 197087 - narrowing errors with clang-8.0
Summary: narrowing errors with clang-8.0
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-18 18:43 PDT by Khem Raj
Modified: 2023-09-08 15:38 PDT (History)
2 users (show)

See Also:


Attachments
proposed fix (1.18 KB, patch)
2019-04-18 18:44 PDT, Khem Raj
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Khem Raj 2019-04-18 18:43:03 PDT
Following error is reported by clang on arm

In file included from DerivedSources/WebCore/unified-sources/UnifiedSource-5037b3e8-3.cpp:2:
/mnt/a/yoe/build/tmp/work/cortexa7t2hf-neon-vfpv4-yoe-linux-gnueabi/webkitgtk/2.24.0-r0/webkitgtk-2.24.0/Source/WebCore/contentextensions/NFAToDFA.cpp:352:43: error: non-constant-expression cannot be narrowed from type 'char' to 'signed char' in initializer list [-Wc++11-narrowing]
            dfa.transitionRanges.append({ range.first, range.last });
                                          ^~~~~~~~~~~
/mnt/a/yoe/build/tmp/work/cortexa7t2hf-neon-vfpv4-yoe-linux-gnueabi/webkitgtk/2.24.0-r0/webkitgtk-2.24.0/Source/WebCore/contentextensions/NFAToDFA.cpp:352:43: note: insert an explicit cast to silence this issue
            dfa.transitionRanges.append({ range.first, range.last });
                                          ^~~~~~~~~~~
                                          static_cast<signed char>( )
/mnt/a/yoe/build/tmp/work/cortexa7t2hf-neon-vfpv4-yoe-linux-gnueabi/webkitgtk/2.24.0-r0/webkitgtk-2.24.0/Source/WebCore/contentextensions/NFAToDFA.cpp:352:56: error: non-constant-expression cannot be narrowed from type 'char' to 'signed char' in initializer list [-Wc++11-narrowing]
            dfa.transitionRanges.append({ range.first, range.last });
                                                       ^~~~~~~~~~
/mnt/a/yoe/build/tmp/work/cortexa7t2hf-neon-vfpv4-yoe-linux-gnueabi/webkitgtk/2.24.0-r0/webkitgtk-2.24.0/Source/WebCore/contentextensions/NFAToDFA.cpp:352:56: note: insert an explicit cast to silence this issue
            dfa.transitionRanges.append({ range.first, range.last });
                                                       ^~~~~~~~~~
                                                       static_cast<signed char>( )
2 errors generated.
Comment 1 Khem Raj 2019-04-18 18:44:05 PDT
Created attachment 367781 [details]
proposed fix
Comment 2 Fujii Hironori 2019-04-18 23:28:47 PDT
Did you read this? https://webkit.org/contributing-code/
Comment 3 Ahmad Saleem 2023-09-08 15:38:33 PDT
https://github.com/WebKit/WebKit/blob/256590954964b0f4ead4ad3aa3289bb97bc1f5c4/Source/WebCore/contentextensions/NFAToDFA.cpp#L349

^ Do we need this or we do even have clang 8 supported or we moved to newer version and don't need this?