[Ltrace-devel] [PATCH] Fix build with Clang on FreeBSD

Petr Machata pmachata at redhat.com
Mon Feb 11 22:26:44 UTC 2013


There seems to be something wrong with either your diff program, or your
mailer, or alternatively something mangled it on the way.  Maybe try to
post as attachment?  I generally prefer inline, but if it's broken...

Thanks,
PM

Andrey Zonov <zont at FreeBSD.org> writes:

> diff --git a/lens_default.c b/lens_default.c
> index ed3d0e1..9f60dae 100644
> --- a/lens_default.c
> +++ b/lens_default.c
> @@ -673,7 +673,7 @@ bitvect_lens_format_cb(struct lens *lens, FILE *stream,
>  	unsigned neg = bits > sz * 4 ? 0xff : 0x00;

Empty context line is missing here.

>   	int o = 0;
> -	if (acc_fprintf(&o, stream, "%s<", "~" + (neg == 0x00)) < 0)
> +	if (acc_fprintf(&o, stream, "%s<", &"~"[neg == 0x00]) < 0)
>  		return -1;
>   	size_t bitno = 0;
> diff --git a/options.c b/options.c
> index eaf32fa..693676b 100644
> --- a/options.c
> +++ b/options.c
> @@ -291,7 +291,7 @@ parse_filter(struct filter *filt, char *expr, int
> operators)

This line wrapped.

>  	enum filter_rule_type type = FR_ADD;

Empty line missing.

>   	while (*expr != 0) {
> -		size_t s = strcspn(expr, "-+@" + (operators ? 0 : 2));
> +		size_t s = strcspn(expr, &"-+@"[operators ? 0 : 2]);
>  		char *symname = expr;
>  		char *libname;
>  		char *next = expr + s + 1;
> @@ -310,7 +310,7 @@ parse_filter(struct filter *filt, char *expr, int
> operators)

Wrapped line.  A couple more of these follow.



More information about the Ltrace-devel mailing list