Re: [PATCH 3/5] evaluate: check variadic argument types against formatting info

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

 



On Wed, Sep 25, 2019 at 11:00:13AM +0100, Ben Dooks wrote:
> +		if (*ptr == 'x' || *ptr == 'X' || *ptr == 'u' || *ptr == 'o') {
> +			ptr++;
> +			type->test = printf_fmt_numtype;
> +			switch (szmod) {
> +			case -1:
> +				type->data = &ushort_ctype;
> +				break;
> +			case 0:
> +				type->data = &uint_ctype;
> +				break;
> +			case 1:
> +				type->data = &ulong_ctype;
> +				break;
> +			case 2:
> +				type->data = &ullong_ctype;
> +				break;
> +			default:
> +				type->test = NULL;
> +			}
> +		} else if (*ptr == 'i' || *ptr == 'd') {
> +			ptr++;
> +			type->test = printf_fmt_numtype;
> +			switch (szmod) {
> +			case -1:
> +				type->data = &short_ctype;
> +				break;
> +			case 0:
> +				type->data = &int_ctype;
> +				break;
> +			case 1:
> +				type->data = &long_ctype;
> +				break;
> +			case 2:
> +				type->data = &llong_ctype;
> +				break;
> +			default:
> +				type->test = NULL;
> +			}

When testing this on the kernel, I've a bunch of
	warning: incorrect type in argument . (different types)
	   expected unsigned int
	   got int
This will quickly be quite annoying.

I've also a bunch of:
	warning: incorrect type in argument . (different types)
	   expected int
	   got int
but I can't investigate more for now.

Putting this aside, the series seesm to already been pretty good.
Congrats!

-- Luc



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux