paper-machine comments on Hand vs. Fingers - Less Wrong

25 Post author: Eliezer_Yudkowsky 30 March 2008 12:36AM

You are viewing a comment permalink. View the original post to see all comments and the full post content.

Comments (94)

Sort By: Old

You are viewing a single comment's thread. Show more comments above.

Comment author: ec429 14 September 2011 01:20:29PM *  8 points [-]

As a C programmer who hangs out in comp.lang.c, I'm strongly tempted to get out a copy of C99 so that I can tell you precisely where you're wrong there. But I'll content myself with pointing out that there is no guarantee that sizeof(long)==2*sizeof(short)==4*sizeof(char), and moreover that even if that did hold, there is still no guarantee that sizeof(struct {short hi; short lo;})==2*sizeof(short) because the struct might have padding - what if 'short' were a 16 bit quantity but stored in 32 bit words (perhaps because the arch can only do 32 bit writes, and has decided that short should be an int_fast16_t rather than an int_least16_t), resulting in alignment requirements?

In conclusion, PK should learn some basic C, and forget about the ++. (Old joke: what does C++ mean? Take C, add to it, then use the old version)

EDIT: thanks, paper-machine, and I approve of Markdown's choice of escape character. Now, if it'll just let me use \033[1;35m to change the colour...

Comment author: [deleted] 14 September 2011 01:25:19PM *  0 points [-]

Upvoted for delicious, delicious C.

EDIT: However, you may want to work on the markdown; * is a reserved character ;_;