Bug 275070 - static_assert in wtf/DataLog.cpp causes warning on Linux
Summary: static_assert in wtf/DataLog.cpp causes warning on Linux
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P4 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-06-03 12:31 PDT by Marcus Plutowski
Modified: 2024-06-03 16:24 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.