Bug 220062 - warning: enumerated and non-enumerated type in conditional expression in Compiler.cpp
Summary: warning: enumerated and non-enumerated type in conditional expression in Comp...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: ANGLE (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-12-21 11:07 PST by Michael Catanzaro
Modified: 2020-12-22 15:45 PST (History)
11 users (show)

See Also:


Attachments
Patch (1.85 KB, patch)
2020-12-21 11:10 PST, Michael Catanzaro
no flags Details | Formatted Diff | Diff
Patch (2.14 KB, patch)
2020-12-21 11:14 PST, 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-12-21 11:07:29 PST
[740/5326] Building CXX object Source/...src/compiler/translator/Compiler.cpp.o
../../Source/ThirdParty/ANGLE/src/compiler/translator/Compiler.cpp: In member function ‘bool sh::TCompiler::checkAndSimplifyAST(sh::TIntermBlock*, const sh::TParseContext&, ShCompileOptions)’:
../../Source/ThirdParty/ANGLE/src/compiler/translator/Compiler.cpp:726:43: warning: enumerated and non-enumerated type in conditional expression [-Wextra]
  725 |     unsigned int simplifyScalarized = (compileOptions & SH_SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS)
      |                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  726 |                                           ? IntermNodePatternMatcher::kScalarizedVecOrMatConstructor
      |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  727 |                                           : 0;
      |                                           ~~~

So we could fight warnings like this as they appear... but honestly, building ANGLE with -Wextra is too aggressive IMO. -Wextra is great for code that we control, where the burden of squashing warnings is relatively low. But with ANGLE, we have to either land fixes upstream, or carry them downstream forever. It doesn't make sense to bother with this for minor build warning fixes when upstream is clearly not using the same warning flags and/or same compiler that we do. So I suggest we simply disable -Wextra for all of ANGLE.
Comment 1 Michael Catanzaro 2020-12-21 11:10:40 PST
Created attachment 416611 [details]
Patch
Comment 2 EWS Watchlist 2020-12-21 11:11:45 PST
Note that there are important steps to take when updating ANGLE. See https://trac.webkit.org/wiki/UpdatingANGLE
Comment 3 Michael Catanzaro 2020-12-21 11:14:24 PST
Created attachment 416612 [details]
Patch
Comment 4 Radar WebKit Bug Importer 2020-12-22 10:59:01 PST
<rdar://problem/72593062>
Comment 5 EWS 2020-12-22 15:45:55 PST
Committed r271066: <https://trac.webkit.org/changeset/271066>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 416612 [details].