https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114609

--- Comment #2 from arnaud.lb at gmail dot com ---
I can not think of any location where this warning would make sense for this
code. The warning behaves as if we did this:

```
(&state)->member == 1 ? (_Bool)&state : (_Bool)0) ? 2 : 3;
```

In this case it would make sense as (_Bool)&state will indeed always be true.

The original code looks more like this:

```
struct {
        _Bool valid;
} state;

int effect;

#define getState() ((&state)->valid == 1 ? &state : 0)

void f(void) {
    effect = getState() ? 2 : 3;
}
```

The warning is unfortunate because the code is not explicitly testing the
address of `state`.

Reply via email to