Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this specifically because of the use of
FLB_CONFIG_MAP_BOOL
? Or some general guidance against using thebool
type?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remembered something about the C90 standard being preferred (
bool
was introduced in C99) but I couldn't find a reference to it in fluent-bits coding style (or the apache coding style).In this case it's purely limited to
FLB_CONFIG_MAP_BOOL
(see PR #8904 and the related work).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leonardo-albertovich As we can see that the current fluent-bit code is already C99 standard because we are using the 'inline', 'long long int'... which are introduced from C99 standard. Just curious why we use
int
to storing data ofFLB_CONFIG_MAP_BOOL
instead of one-byte data type like bool or char? The one-byte data type can work well in both LE(x86) and BE(s390x) systems. Influent_config_map.h
, we declarechar
to store the value ofFLB_CONFIG_MAP_BOOL
.But in
src/flb_config_map.c
8904 and plugins, we turn to useint
to store data ofFLB_CONFIG_MAP_BOOL
, it's confusing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm good point, it's confusing. You are right, we are in C99 based on our use of
inline
.Since there are several patches around this right now, I would suggest to continue using
int
and for Fluent Bit v3.2 move formally tobool
(we will move to v3.2 dev shortly)