Skip to contentSkip to conversation

libtraceevent: Fix for print_field

PATCH Applied Ian Rogers 2 participants 4 messages Sep 21, 2021 – Oct 12, 2021

lore
Share & tools
lore

Ian Rogers

author
#0 lore raw

PATCH 1/1 libtraceevent: Fix for print_field

Correct a typo in an operator which resolves a clang warning:

src/event-parse.c:5408:41: error: converting the enum constant to a boolean [-Werror,-Wint-in-bool-context]

        if (field->flags & (TEP_FIELD_IS_ARRAY || TEP_FIELD_IS_STRING))
                                               ^
---
 src/event-parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/event-parse.c +1 -1
index 8057fb5..7063758 100644
@@ -5405,7 +5405,7 @@ void static inline print_field(struct trace_seq *s, void *data,
 	if (!parse || event->flags & TEP_EVENT_FL_FAILED)
 		goto out;
 
-	if (field->flags & (TEP_FIELD_IS_ARRAY || TEP_FIELD_IS_STRING))
+	if (field->flags & (TEP_FIELD_IS_ARRAY | TEP_FIELD_IS_STRING))
 		goto out;
 
 	start_parse = parse;
Signature · 1 line
2.33.0.464.g1972c5931b-goog
author
#1 lore raw
Quoted 7 lines · Ian Rogers

Correct a typo in an operator which resolves a clang warning:

src/event-parse.c:5408:41: error: converting the enum constant to a boolean [-Werror,-Wint-in-bool-context]

        if (field->flags & (TEP_FIELD_IS_ARRAY || TEP_FIELD_IS_STRING))
                                               ^

Ping. Thanks,
Ian

Quoted 20 lines
---
 src/event-parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/event-parse.c +1 -2
index 8057fb5..7063758 100644
@@ -5405,7 +5405,7 @@ void static inline print_field(struct trace_seq *s, void *data,
        if (!parse || event->flags & TEP_EVENT_FL_FAILED)
                goto out;
 
-       if (field->flags & (TEP_FIELD_IS_ARRAY || TEP_FIELD_IS_STRING))
+       if (field->flags & (TEP_FIELD_IS_ARRAY | TEP_FIELD_IS_STRING))
                goto out;
 
        start_parse = parse;
--

2.33.0.464.g1972c5931b-goog

#3 lore raw
In reply to Ian Rogers
Quoted 16 lines · On Mon, 20 Sep 2021 11:37:15 -0700 Ian Rogers <[email protected]> wrote:

Correct a typo in an operator which resolves a clang warning:

src/event-parse.c:5408:41: error: converting the enum constant to a boolean [-Werror,-Wint-in-bool-context]

        if (field->flags & (TEP_FIELD_IS_ARRAY || TEP_FIELD_IS_STRING))
                                               ^
---
 src/event-parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/event-parse.c +0 -0
index 8057fb5..7063758 100644

src/event-parse.c void static inline print_field(struct trace_seq *s, void *data, · line 5408

Quoted 5 lines
src/event-parse.c +1 -1
@@ -5405,7 +5405,7 @@ void static inline print_field(struct trace_seq *s, void *data,
 	if (!parse || event->flags & TEP_EVENT_FL_FAILED)
 		goto out;
 
-	if (field->flags & (TEP_FIELD_IS_ARRAY || TEP_FIELD_IS_STRING))
+	if (field->flags & (TEP_FIELD_IS_ARRAY | TEP_FIELD_IS_STRING))

Bah, I should have caught this in my review.

Another example of the usefulness of clang errors.

Applied, thanks Ian!

-- Steve

Quoted 3 lines
src/event-parse.c +0 -0
 		goto out;
 
 	start_parse = parse;