A dreadful thing

Saturday, October 4th, 2008 10:32
[personal profile] kpreid
some type *foo;
size_t count = ...;

...

foo = malloc(count * sizeof * foo);

Re: My favourite

Date: 2009-04-19 17:14 (UTC)
From: [identity profile] kpreid.livejournal.com
I just noticed that this is valid Haskell code, defining a function. As well as C code not defining a function.

Re: My favourite

Date: 2009-04-22 08:27 (UTC)
From: [identity profile] rgs26.livejournal.com
The C code exhibits undefined behaviour. If the stack garbage used as 'x' is a signaling NaN, that line can cause your program to crash...