Bug 275070

Summary: static_assert in wtf/DataLog.cpp causes warning on Linux
Product: WebKit Reporter: Marcus Plutowski <marcus_plutowski>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P4 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Marcus Plutowski 2024-06-03 12:31:43 PDT
rdar://129177831

gcc doesn’t like && on constant operands:

/var/home/phil/WebKit/Source/WTF/wtf/DataLog.cpp:48:19: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]                                                                            
   48 | static_assert(!(0 && 0), "Set at most one data-log file target");                                                                                                                                          
      |                   ^  ~                                                                                                                                                                                     
/var/home/phil/WebKit/Source/WTF/wtf/DataLog.cpp:48:19: note: use '&' for a bitwise operation                                                                                                                      
   48 | static_assert(!(0 && 0), "Set at most one data-log file target");                                                                                                                                          
      |                   ^~                                                                                                                                                                                       
      |                   &                                                                                                                                                                                        
/var/home/phil/WebKit/Source/WTF/wtf/DataLog.cpp:48:19: note: remove constant to silence this warning                                                                                                              
   48 | static_assert(!(0 && 0), "Set at most one data-log file target");                                                                                                                                          
      |                   ^~~~                                                                                                                                                                                     
1 warning generated. 

This causes some minor log spam and so should be fixed.
Comment 1 Marcus Plutowski 2024-06-03 12:39:32 PDT
Pull request: https://github.com/WebKit/WebKit/pull/29469
Comment 2 EWS 2024-06-03 16:24:18 PDT
Committed 279679@main (00896ef855fa): <https://commits.webkit.org/279679@main>

Reviewed commits have been landed. Closing PR #29469 and removing active labels.