https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115724
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|UNCONFIRMED |NEW
Severity|normal |enhancement
Ever confirmed|0 |1
Last reconfirmed| |2024-07-02
Summary|analyzer does not recognise |analyzer does not recognise
|non-returning error() |glibc (GNU) extension,
| |non-returning error
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
You could add __builtin_unreachable() after the call to error in this case and
the warning goes away.
error is a glibc extension too.
Maybe analyzer could add support for it but I suspect it is low priority since
there are other things that can be improved for analyzer (maybe something like
-fanalyzer-enable-gnu-extensions could be added for all of the non-standard
ones, -fanalyzer-enable-freebsd-extensions, etc. could be added too).
Anyways confirmed for now.