forked from illumos/illumos-gate
-
Notifications
You must be signed in to change notification settings - Fork 107
Open
Description
From <stdbool.h>:
#ifndef __cplusplus
#if defined(_STDC_C99) || defined(__C99FEATURES__) || __GNUC__ >= 3
#undef bool
#undef true
#undef false
#define bool _Bool
#define true 1
#define false 0
#define __bool_true_false_are_defined 1
#endif /* defined(_STDC_C99) || defined(__C99FEATURES__) || __GNUC__ >= 3 */
#endif /* __cplusplus */
<rpcsvc/yp_prot.h> in turn contains:
/* 'bool' is a built-in type for g++ */
#if !(defined(__cplusplus) && defined(_BOOL)) && !defined(__GNUG__)
#ifndef BOOL_DEFINED
typedef unsigned int bool;
#define BOOL_DEFINED
#endif
#endif
The latter is a syntax error if the first #define is active as it expands to:
typedef unsigned int _Bool;
Where _Bool is a keyword in C11 and later.
BTW: Note also that bool in itself is a keyword in C23 and later.
My suggestion is to update <sys/stdbool.h> to:
- Define
BOOL_DEFINED(or alter the test in<rpcsvc/yp_prot.h>to check__bool_true_false_defined). - Update it to know about C23 (not strictly necessary as
_Boolis still an alias).
Metadata
Metadata
Assignees
Labels
No labels