待辦事項 #41062

clang extraneous paren warning

啟用日期: 2020-12-19 03:34 最後更新: 2021-01-08 08:18

回報者:
負責人:
類型:
狀態:
關閉
元件:
(無)
優先權:
1 - 最低
嚴重程度:
1 - 最低
處理結果:
檔案:

細節

The clang compiler (at least version 12.0.0 running on Mac OS 10.15.7) issues warnings for constructs like

else if ((trapped_ptr->pseikaku == PERSONALITY_CHARGEMAN))

The warning message is

warning: equality comparison with extraneous parentheses [-Wparentheses-equality]

It gives two suggestions for how to handle it:

note: remove extraneous parentheses around the comparison to silence this warning

or

note: use '=' to turn this equality comparison into an assignment

This commit, https://osdn.net/projects/hengbandforosx/scm/git/hengbandosx/commits/dad39d6e1650bddfb43a38c57faa03d6c0f3097d , on the release/3.0.0Alpha-clang-extraneous-paren branch of the hengbandforosx project has the changes to remove the extraneous parentheses and silence the warning from the clang compiler.

Ticket History (3/3 Histories)

2020-12-19 03:34 Updated by: backwardseric
  • New Ticket "clang extraneous paren warning" created
2020-12-19 11:46 Updated by: deskull
2021-01-08 08:18 Updated by: deskull
  • 狀態 Update from 開啟 to 關閉
評語

It have been merged. Thanks.

Attachment File List

No attachments

編輯

Please login to add comment to this ticket » 登入