opnsense-src/test/Analysis/sizeofpointer.c

9 lines
224 B
C
Raw Normal View History

2010-01-01 05:34:51 -05:00
// RUN: %clang_cc1 -analyze -warn-sizeof-pointer -verify %s
2009-11-18 09:59:57 -05:00
struct s {
};
int f(struct s *p) {
return sizeof(p); // expected-warning{{The code calls sizeof() on a pointer type. This can produce an unexpected result.}}
}