ALL
Integer overflow
You may be familiar with integer overflow, but what you may not be familiar with is how gcc handles signed integer overflow.First let's look at the standard, for unsigned integer, the standard says :A computation involving unsigned operands can never overflow, because a result that cannot be represented by the resulting unsigned integer type is reduced modulo the number that is one greater than the largest value that can be represented by the resulting type.In other words, unsigned integer overflow will be wrapped so that it will be still in the range of an unsigned integer.For signed integer,...
4,047 0 LINUX GCC INTEGER OVERFLOW
GCC is compiled with C++ compiler
On 15 Aug, 2012, GCC merged a patch--Merge from cxx-conversion branch . This means GCC will be compiled with C++ compiler in the future, it also means that GCC will be implemented using C++.You may have following two puzzles:Why does GCC turn to C++?Without C++ compiler, how can we compile C++ codes?Why using C++?In GNU's C++ Conversion, we can find this description in the background section:Whether we use C or C++, we need to try to ensure that interfaces are easy to understand, that the code is reasonably modular, that the internal documentation corresponds to the code,&n...
The "C is Efficient" Language Fallacy
I came across an article yesterday about programming languages, which hit on oneof my major peeves, so I can't resist responding. The article is at greythumb.org,and it's called Programmer's rant: what should and should not be added to C/C++.It's a variation on the extremely common belief that C and C++ are the best languages to use when you need code to run fast. They're not. They're good at things that need to get very close to the hardware - not in the efficiency sense, but in the sense of needing to be able to fairly directly munge the stack, address specific hardware registers, etc. But...
3,098 0 C EVOLVEMENT GCC FALLACY