Bug 91741 - Implement new warning -Wsizeof-array-div
Summary: Implement new warning -Wsizeof-array-div
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 10.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks: new-warning
  Show dependency treegraph
 
Reported: 2019-09-11 15:41 UTC by Marek Polacek
Modified: 2019-10-23 02:46 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2019-09-11 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Polacek 2019-09-11 15:41:05 UTC
... to detect things like: https://www.viva64.com/en/examples/v706/
Comment 1 Jonathan Wakely 2019-09-11 16:05:46 UTC
Looks like a good idea for a warning.

But please don't make the diagnostic say "every element", since I hope all the elements of an array have the same size, so you don't need to consider every one of them ;-)
Comment 2 Eric Gallager 2019-09-11 16:06:36 UTC
I thought we already had this, but I guess I was thinking of -Wsizeof-pointer-div instead...