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

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

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Wnull-dereference warning happens in the middle-end and not in the early
optimization phase so after LTO.

So if  we add:
```

int main()
{
        RideMainOpen();
}
```
to the godbolt and then link to an executable. We do get a warning:
In member function 'ColourOnDrawSecondaryPreview',
    inlined from '__ct ' at <source>:33:37,
    inlined from 'h' at <source>:18:34,
    inlined from 't' at <source>:49:27,
    inlined from 'RideMainOpen' at <source>:53:6,
    inlined from 'main' at <source>:59:21:
<source>:41:50: warning: null pointer dereference [-Wnull-dereference]
   41 |         if (stationObj == nullptr && stationObj->entranceBackIndex ==
kImageIndexUndefined)
      |                                                  ^



https://godbolt.org/z/57dsjdPqj

Reply via email to