Re: [PATCH 3/3] initial variadic argument code

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

 



On Fri, Oct 26, 2018 at 06:32:05PM +0100, Ben Dooks wrote:
> On 26/10/18 18:28, Ben Dooks wrote:
> > On 26/10/18 16:26, Ben Dooks wrote:
> > 
> > > +            case 'p':
> > > +                /* TODO - deal with void * not being
> > > de-referenced in some cases*/
> > > +                sym = &ptr_ctype;
> > > +                break;
> > > +            case 'q':
> > 
> > For the case of %p, is MOD_NODEREF sufficient, or should we also have
> > a flag (either MOD_NOADDRSPACE) or some other way of specifying the
> > type is safe for any address space?
> > 
> > I added a ptr_ctype_noderef, but still get:
> > 
> > test.c:27:37: warning: incorrect type in argument 3 (different
> > address spaces)
> > test.c:27:37:    expected string
> > test.c:27:37:    got void [noderef] <asn:1>*b
> 
> I meant:
> 
> test.c:28:37: warning: incorrect type in argument 3 (different
> address spaces)
> test.c:28:37:    expected void [noderef] *
> test.c:28:37:    got void [noderef] <asn:1>*b

For the type checking, there is no such thing as a type safe for
any address space. You will probably need to special-case it,
For example defining an abstract/generic pointer type (gen_ptr_type)
and then doing something like:
		if (i >= fn->printf_va_start && i <= variadic_limit)
			target = variadic[i - fn->printf_va_start];
		else
			target = argtype;
		if (!target) {
			...
+		} else if (target == &gen_ptr_type) {
+				...
		} else if (!target->forced_arg){

-- 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