Profile cover photo
Profile photo
Colin King
963 followers -
Using know-how as a tool to get interesting problems solved
Using know-how as a tool to get interesting problems solved

963 followers
About
Communities and Collections
View all
Posts

Post has attachment

Post has attachment

gcc -Wall -Wextra and clang -Wall -Wextra don't produce any warnings on this dodgy -ve array sized code:

int foo(int n)
{
char a[n];

a[0] = 0;

return sizeof(a);
}

int main(void)
{
return foo(-1);
}
Add a comment...

Post has attachment

Post has shared content

C99 Quiz. What does the following return?

int main(void)
{
return (const char []){"foo"} == "foo";
}
Add a comment...

I like the way one can specify minimum size of arrays in C99

void foo(char a[static const 1])
{
}

..this allows one to ensure that the array is at least one element long and no NULLs can be passed. Nice feature for sure.
Add a comment...

Post has shared content
Add a comment...

Post has attachment
Hard-drives acting as a crude microphone: https://www.youtube.com/watch?v=ntw32kYDryM
Add a comment...

LD [M] drivers/scsi/mpt3sas/mpt3sas.ko
make[3]: fork: Cannot allocate memory

bah, need more swap.
Add a comment...
Wait while more posts are being loaded