Blog

Sign extension
Pascal Cuoq on 25 April 2013

There is no “sign extension” in C. Please stop referring to “sign extension” in C programs. In assembly, there is such a thing as “sign extension” Sign-extend is an assembly instruction say movsx %al %ebx to transfer the contents of a narrow register say %al to a wide register say...

Read More

Making oughts from ises
Pascal Cuoq on 13 April 2013

A previous post discussed the nature of uninitialized and indeterminate memory throughout the C standards. The argument was “avoid using uninitialized data even if you think you know what you are doing; you may be right but regardless your compiler might think it knows what you are doing and be...

Read More

Google forking WebKit
Pascal Cuoq on 4 April 2013

Blink as seen from the inside As you have undoubtedly heard if you follow at all this sort of thing, as of April 3, Google is forking WebKit. Its Chrome browser will henceforth rely on its own variation of the popular rendering engine, Blink. This is big news. If I...

Read More

str2long
Pascal Cuoq on 20 March 2013

A coding contest of weeks past A fortnight ago, I sent an entry in this Quick Coding Contest. The objective of the contest is to produce a C function to convert a string to the integer it represents. Now it turns out that my submission generates the shortest code after...

Read More