RE: [PATCH v2 02/10] netfilter: Avoid assigning 'const' pointer to non-const pointer

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

 



From: Linus Torvalds
> Sent: 24 January 2020 17:37
...
> (That also means that the compiler can't necessarily even optimize
> multiple accesses through a const pointer away, because the object
> might be modified through another pointer that aliases the const one -
> you'd need to also mark it "restrict" to tell the compiler that no
> other pointer will alias).

I've seen gcc cache a value read through a 'const' parameter pointer
across a function call.
Can't remember which version though.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)




[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux