Re: constness bug in include/linux/compiler.h

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

 



Yes, that makes sense.  These functions just check for the annotation on their
pointer argument, and having the const annotation would allow them to check
const pointers without provoking a warning due to the lack of const.

They don't provoke a warning now.  Sparse is silent on this program:

	#define __user __attribute__((noderef, address_space(1)))

	extern void __chk_user_ptr(void __user *);

	void
	f(const void __user *p)
	{
		__chk_user_ptr(p);
	}

but arguably they should (and then be changed to const void __user*).

For an actual example, __copy_from_user_inatomic has a
const void __user* argument which it passes (via __get_user_size)
to __chk_user_ptr.

Russ
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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