My 2 month beef with my own Linux environment. (Developer cautionary tale)

20 points by NICUP14


BenjaminRi

This should be a blog post, rather than a reddit post. Also, kudos for the persistence, I'm sure the author learned a lot.

robey

I call this pattern "Maybe gravity is disabled": When you have a blind spot for the real problem, and everything else seems to be working, and you start to question basic assumptions about the universe itself. Maybe the compiler is broken? Maybe adding integers doesn't work if they're all mulitples of three? Maybe gravity was disabled around our office?

It's extremely common (myself included) and it takes a minute to realize you should take a step back and hit it from a different angle... that gravity is probably still enabled in our quadrant. :)

nortti

I'm surprised this did not break any further. Did you take a look at the generated code to see if it happens to leave most of the argument registers intact?

pja

Even the final version shown here isn’t great - OP is forced to generate code that can only cope with a fixed number of varargs arguments because there’s no way to forward varargs to a subsequent function call inside an existing varargs function.

This wart was patched for the few functions that obviously need it in libc by adding functions like vprintf() that take a va_list * as a final argument, but it would have been much simpler for everyone, with the bonus of future proofing the language, if they’d just made it possible to forward varargs.