Bug 22546 - does not warn for out-of-bound array access
Summary: does not warn for out-of-bound array access
Status: RESOLVED DUPLICATE of bug 8268
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2005-07-18 13:42 UTC by Richard Biener
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2005-07-18 13:42:46 UTC
void foo(void)
{
  int i[2];
  i[2] = 0;
  i[3] = 0;
}

does not get warned on, even with -Wall.  This might catch some subtle
bugs in gcc itself.
Comment 1 Paolo Carlini 2005-07-18 13:45:22 UTC
How does this relate to mudflap?!?
Comment 2 Paolo Carlini 2005-07-18 14:01:07 UTC
My vague idea would be that mudflap already does this (and *much* more). Maybe
a small part of its logic could be moved to a compile-time warning.
Comment 3 Andrew Pinski 2005-07-18 14:02:43 UTC
(In reply to comment #1)
> How does this relate to mudflap?!?

Compile time vs runtime warnings.
This is also a dup of bug 8268.


*** This bug has been marked as a duplicate of 8268 ***

*** This bug has been marked as a duplicate of 8268 ***