-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:static analyzerworksformeResolved as "works for me"Resolved as "works for me"
Description
| Bugzilla Link | 9574 |
| Resolution | WORKSFORME |
| Resolved on | May 07, 2012 23:32 |
| Version | trunk |
| OS | All |
| Attachments | Reduced test case |
| Reporter | LLVM Bugzilla Contributor |
| CC | @tkremenek |
Extended Description
I attach a case where clang wrongly reports uninitialized field in nested struct.
------ field.c ------
typedef struct { double x, y; } NSPoint;
typedef struct { NSPoint origin; } NSRect;
static const NSPoint NSZeroPoint = { 0, 0 };
double test(void) {
NSRect frame = { NSZeroPoint };
return frame.origin.x;
}
$ clang --analyze field.c
field.c:8:2: warning: Undefined or garbage value returned to caller
return frame.origin.x;
^ ~~~~~~~~~~~~~~
1 warning generated.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:static analyzerworksformeResolved as "works for me"Resolved as "works for me"