Re: gcc extension in get_user_pages

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

 



Momchil Velikov <velco@fadata.bg> writes:

>>>>>> "Paul" == Paul Gearon <pag@PISoftware.com> writes:
>
> Paul> You got me curious, so I checked.  With the kernel optimisations of -O2
> Paul> then there's no difference.
>
> You miss the point.  And the point is that that ``x'' (denoting an
> expression) is evaluated only once.
>
> For example, ``y = x++ ?: 2;' is defined, while ``y = x++ ? x : 2;''
> invoked undefined behavior.

That's an interesting point.  It can't be the reason why the gcc
extension is used in this case, though, since it's just an integer, i,
and not an arbitrary expression with possible side effects.

-- 
--Ed L Cashin     PGP public key: http://noserose.net/e/pgp/

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux