top | item 26557230

(no title)

esgwpl | 5 years ago

>The kernel is different from userspace projects - more difficult in some respects (we use a lot of very odd header files that pushes the boundary of what can be called "C"), but easier in many other respects (mainly in the sense that the kernel is fairly self-contained, and then doesn't rely on other projects for the final binary).

I'm interested in what Torvalds meant by these odd header files, does anyone know?

discuss

order

cransoon|5 years ago

  /*
   * This returns a constant expressionn while determining if an argument is
   * a constant expression, most importantly without evaluating the argument.
   * Glory to Martin Uecker <Martin.Uecker@med.uni-goettingen.de>
 */
  #define __is_constexpr(x) \
          (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))

PixelOfDeath|5 years ago

The dark side of c is a pathway to many abilities, some considered to be unnatural

nmfisher|5 years ago

Jesus, can someone unravel that for me?

joseluisq|5 years ago

Wow! the above code is described by itself about what Torvalds means with: very odd header files that *pushes the boundary* of what can be called "C".

I'm not a C dev BTW.

120bits|5 years ago

wow! As mainly a Java engineer. This is an alien language to me.

tambourine_man|5 years ago

Probably some crazy macros that the kernel code uses. You can end up having an almost dialect of C with extensive use.