Bug 220062

Summary: warning: enumerated and non-enumerated type in conditional expression in Compiler.cpp
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: ANGLEAssignee: Michael Catanzaro <mcatanzaro>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, dino, ews-watchlist, graouts, gyuyoung.kim, kondapallykalyan, mcatanzaro, ryuan.choi, sergio, smoley, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Patch
none
Patch none

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].