[fpc-pascal] Changing variable in conditional

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Wed Jan 9 11:46:54 CET 2013

Henry Vermaak wrote:
> On Wed, Jan 09, 2013 at 08:42:22AM +0000, Mark Morgan Lloyd wrote:
>> But if you want an example of a very nasty bug caused by C/C++
>> multiple assignment, there was a well-documented attempt to slip a
>> privilege escalation into the Linux kernel based on this a few years
>> ago.
>> It's very easy to argue against multiple assignment. It's less easy
>> to argue against implementing an equivalent of the C/C++
>> conditional.
> Are you talking about this one?
> http://lwn.net/Articles/57135/

Yes, although it took me a few minutes Googling after I posted the 
earlier comment before I had the reference to hand.

I've got a vague recollection that since that episode the kernel 
maintainers have mandated a use of parentheses that helps the compiler 
pick up the distinction between an equality and an assignment. But it's 
unfortunate when programmers have to use a contrived form to work around 
sloppiness in the language design... I'm specifically talking about 
ill-conceived syntax here, not about flexibility that you get from easy 
access to things like pointer arithmetic.

Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

More information about the fpc-pascal mailing list