Bobbing for Kernels

See Bob. See Bob bob. Bob, Bob, bob!

Archive for the ‘C’ Category

Variadic functions in C: a new idiom?

Posted by kernelbob on April 5, 2010

For a long time, C has let you write functions that take a variable number of arguments.  But C leaves it up to each variadic function to figure out how many arguments it’s been passed, and up to each caller to pass the right arguments.

Here’s a cute hack to make variadic functions easier to write and a little harder to call incorrectly.

Read the rest of this entry »

Advertisements

Posted in C | Tagged: , , , | 5 Comments »