gcc/testsuite/c-c++-common/analyzer/pr105783.c
raw| 1 | /* { dg-additional-options "-O" } */ |
| 2 | |
| 3 | struct ss_s { |
| 4 | union out_or_counting_u { |
| 5 | char *newstr; |
| 6 | unsigned long long cnt; |
| 7 | } uu; |
| 8 | bool counting; |
| 9 | }; |
| 10 | |
| 11 | struct ss_s ss_init(void) { |
| 12 | struct ss_s rr = { .counting = 1 }; |
| 13 | return rr; |
| 14 | } |
| 15 | |
| 16 | void ss_out(struct ss_s *t, char cc) { |
| 17 | if (!t->counting) { |
| 18 | *t->uu.newstr++ = cc; |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | int main() { |
| 23 | struct ss_s ss = ss_init(); |
| 24 | ss_out(&ss, 'a'); |
| 25 | } |
| 26 |