[lttng-dev] [PATCH babeltrace] Fix: Suppress a compiler warning (always-false condition)

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Wed May 15 02:11:30 EDT 2013


* Jérémie Galarneau (jeremie.galarneau at efficios.com) wrote:
> Clang reports an always-false condition (checking if an unsigned value < 0)
> caused by a type mismatch in ctf-visitor-generate-io-struct.c.

manually split into 2 commits (cleanups is a separate commit).

merged,

Thanks,

Mathieu

> 
> Remove trailing whitespaces.
> 
> Signed-off-by: Jérémie Galarneau <jeremie.galarneau at efficios.com>
> ---
>  formats/ctf/metadata/ctf-visitor-generate-io-struct.c | 13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c
> index 0002fe4..c4208b7 100644
> --- a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c
> +++ b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c
> @@ -649,7 +649,7 @@ int ctf_typedef_visit(FILE *fd, int depth, struct declaration_scope *scope,
>  	bt_list_for_each_entry(iter, type_declarators, siblings) {
>  		struct bt_declaration *type_declaration;
>  		int ret;
> -	
> +
>  		type_declaration = ctf_type_declarator_visit(fd, depth,
>  					type_specifier_list,
>  					&identifier, iter,
> @@ -865,7 +865,6 @@ struct bt_declaration *ctf_declaration_struct_visit(FILE *fd,
>  		if (name) {
>  			if (bt_lookup_struct_declaration(g_quark_from_string(name),
>  						      declaration_scope)) {
> -				
>  				fprintf(fd, "[error] %s: struct %s already declared in scope\n", __func__, name);
>  				return NULL;
>  			}
> @@ -936,7 +935,6 @@ struct bt_declaration *ctf_declaration_variant_visit(FILE *fd,
>  		if (name) {
>  			if (bt_lookup_variant_declaration(g_quark_from_string(name),
>  						       declaration_scope)) {
> -				
>  				fprintf(fd, "[error] %s: variant %s already declared in scope\n", __func__, name);
>  				return NULL;
>  			}
> @@ -1105,7 +1103,6 @@ struct bt_declaration *ctf_declaration_enum_visit(FILE *fd, int depth,
>  		if (name) {
>  			if (bt_lookup_enum_declaration(g_quark_from_string(name),
>  						    declaration_scope)) {
> -				
>  				fprintf(fd, "[error] %s: enum %s already declared in scope\n", __func__, name);
>  				return NULL;
>  			}
> @@ -1233,7 +1230,7 @@ int get_boolean(FILE *fd, int depth, struct ctf_node *unary_expression)
>  		fprintf(fd, "[error] %s: unexpected unary expression type\n",
>  			__func__);
>  		return -EINVAL;
> -	} 
> +	}
>  
>  }
>  
> @@ -1479,9 +1476,9 @@ struct bt_declaration *ctf_declaration_floating_point_visit(FILE *fd, int depth,
>  		struct ctf_trace *trace)
>  {
>  	struct ctf_node *expression;
> -	uint64_t alignment = 1, exp_dig = 0, mant_dig = 0,
> -		byte_order = trace->byte_order;
> -	int has_alignment = 0, has_exp_dig = 0, has_mant_dig = 0;
> +	uint64_t alignment = 1, exp_dig = 0, mant_dig = 0;
> +	int byte_order = trace->byte_order, has_alignment = 0,
> +		has_exp_dig = 0, has_mant_dig = 0;
>  	struct declaration_float *float_declaration;
>  
>  	bt_list_for_each_entry(expression, expressions, siblings) {
> -- 
> 1.8.2.2
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list