C, working life, compilers Making integers from pointers on 64 bit Few days ago, my colleague Paolo came to me with an interesting problem he was not able to solve. He had the same code in production and and in a
C, development, GLib The Size Of Allocated Memory In a comment on Google+ to my previous post The Size Of Strings [https://while2.ghost.io/the-size-of-strings/], my colleague Lee Berg [https://plus.google.com/104988514710350965537] asked: > Other
C, development, tips The Size Of Strings It's quite common to find pieces of C code like the following: void do_something() { const char foo[] = "This is foo"; ... func(foo, sizeof(foo)); ... } This
StackOverflow, C Recursion And Stack Overflow Few days ago, the Twitter account of StackOverflow [http://stackoverflow.com/] (the famous site of technical questions and answers) has published the following tweet: > int main() { return main(); } pic.
C, compilers, troubleshooting How C Compilers Work Part 4: Linker Now we are at the point where we have produced one or more object files and we want to create an executable. Under GNU/Linux systems, this job is done
development, C, tips Bitwise Right Shift With Signed Int It's never too late to learn something new. And sometimes the compiler is smarter than what you think. In this case, I've discovered this behavior a
C, compilers How C Compilers Work Part 3: Compiler The properly so called compiler is a really complicated piece of software. It performs many different tasks on single files. This means that no matter if your project is made
C, horror code Horror Code: Paid By The Number Of Rows The first thing I've thought is: "I'm missing something". But after few seconds the doubt that the author of the following code is paid
C, compilers, troubleshooting How C Compilers Work Part 2 - Preprocessor As said in the previous post, in modern compilers, preprocessing is not a separate phase but it's made together with compilation. Nevertheless, understanding the role of preprocessor is
C, compilers How C Compilers Work Part 1 - Introduction I'm writing this series of posts because it seems to me that many young programmers lack a clear idea about what's behind the "Build"
development, C, tests When Unit Tests Fail This week, my colleague +Giancarlo B. [https://plus.google.com/112637999859258390580] showed me this short function. char *unescape(char *in) { char *tmp; int i, x; char b[5]; tmp = calloc(
development, C, C++, style 0 Errors - 0 Warnings Are you one of those that don't care about warnings when compiling? Well, if you write Yoda conditions[1] like the following, probably you are: if (2 == foo)
development, C, C++, style C++ And goto Don't Match Together As you can see by reading this blog, I'm a fan of goto [https://while2.ghost.io/goto_is_your_friend] when used in an appropriate way. Unfortunately
development, C, C++ Power and Control This video is a perfect representation of the Pirelli's slogan "power is nothing without control". You can have the fastest car in the world but if
development, C Self-limited Development I'm sure you have already heard of the following proverb: > If all you have is a hammer, everything looks like a nail. It has come to my
development, personal, C, horror code Horror Code: the Impossible Function This is one of the less readable functions that I've found in my life. I've removed any reference to structures and variable names, according to the
C, security, style, Apple, bugs, Python Indentation Matters Last week my colleague Daniele Veneroni[^1] told me: "You chose the wrong timing to write a post about the usefulness of goto. Have you heard what happened to
development, C Goto Is Your Friend I've started coding when I was 13. In Basic. And no, I'm not gonna say "good old times". Going back to those days, the