[Bug c/109673] New: warn_unused_result warnings are incorrect (and/or missing) and vary when -Os is specified

2023-04-28 Thread parke.nexus at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109673 Bug ID: 109673 Summary: warn_unused_result warnings are incorrect (and/or missing) and vary when -Os is specified Product: gcc Version: 12.2.0 Status: UNCONFIRMED

[Bug c/109673] warn_unused_result warnings are incorrect (and/or missing) and vary when -Os is specified

2023-04-28 Thread parke.nexus at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109673 --- Comment #2 from Parke --- Thank you for the explanation. It seems to me that it would (should?) be possible for -Os to detect the cast-to-void and therefore suppress the second warning (line 5). It also seems to me the above change, if imp