https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122729
Bug ID: 122729
Summary: Including libiberty.h triggers -Wundef warning
("HAVE_DECL_BASENAME" conditional)
Product: gcc
Version: 15.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: Explorer09 at gmail dot com
Target Milestone: ---
The error message is:
```
/usr/include/libiberty/libiberty.h:107:6: error: "HAVE_DECL_BASENAME" is not
defined, evaluates to 0 [-Werror=undef]
107 | #if !HAVE_DECL_BASENAME
| ^~~~~~~~~~~~~~~~~~
```
It seems like the conditional can be changed from:
```
#if !HAVE_DECL_BASENAME
```
to:
```
#if !defined(HAVE_DECL_BASENAME) || !HAVE_DECL_BASENAME
```
and the problem can go away.