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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |INVALID

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced:
```
int *f(const char*);
int *g(int*);
int main()
{
 int* pdir;
 int* pentry;

 pdir = f("d");

 while (pentry = g(pdir)) ;
}
```

No this warning is not bogus and is telling you exactly what it says.

The reason for the warning is because GCC is telling the user that sometimes
they might have meant for == rather than = here.
If you add an extra parentheses around `pentry = g(pdir)`, then the warning
goes away because you are explictly saying you meant that assignment rather
than an equality comparison.

Reply via email to