Re: [PATCH] libtraceevent: Fix for print_field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 20 Sep 2021 11:37:15 -0700
Ian Rogers <irogers@xxxxxxxxxx> 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))
>                                                ^
> 
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
> ---
>  src/event-parse.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/event-parse.c b/src/event-parse.c
> index 8057fb5..7063758 100644
> --- a/src/event-parse.c
> +++ b/src/event-parse.c
> @@ -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

>  		goto out;
>  
>  	start_parse = parse;




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux