1 /* Test -Wsizeof-pointer-div warnings. */
2 /* { dg-do compile } */
3 /* { dg-options "-Wall" } */
9 i
= sizeof array
/ sizeof *array
; /* { dg-warning "does not compute the number of array elements" } */
10 i
+= sizeof array
/ sizeof array
[0]; /* { dg-warning "does not compute the number of array elements" } */
11 i
+= sizeof(array
) / sizeof(*array
); /* { dg-warning "does not compute the number of array elements" } */
12 i
+= sizeof(array
) / sizeof(array
[0]); /* { dg-warning "does not compute the number of array elements" } */
13 i
+= (sizeof(array
)) / (sizeof(array
[0])); /* { dg-warning "does not compute the number of array elements" } */
14 i
+= sizeof(array
) / sizeof(int); /* { dg-warning "does not compute the number of array elements" } */
15 i
+= sizeof(array
) / sizeof(char);
16 i
+= sizeof(*array
) / sizeof(char);
17 i
+= sizeof(array
[0]) / sizeof(char);
26 i
= sizeof array
/ sizeof *array
;
27 i
+= sizeof array
/ sizeof array
[0];
28 i
+= sizeof(array
) / sizeof(*array
);
29 i
+= sizeof(array
) / sizeof(array
[0]);
30 i
+= (sizeof(array
)) / (sizeof(array
[0]));
31 i
+= sizeof(array
) / sizeof(int);
32 i
+= sizeof(array
) / sizeof(char);
33 i
+= sizeof(*array
) / sizeof(char);
34 i
+= sizeof(array
[0]) / sizeof(char);
41 return sizeof a
/ sizeof *a
; /* { dg-warning "Wsizeof-array-argument" } */