> Is there any benefit outside of gcc compatibility? What are the > disadvantages? This broadly impacts *all* code that is/will be built with > -O0 over 1 bad line of code. Someone should make a concise and clear > decision about at which point compatibility makes sense. This seems like a > knee jerk decision >
The main benefit is the ability to build the Linux kernel at all optimization levels. There are many other contexts where compile time constants are used in if-then-else or switch statements. This type of usage has been quite common on Linux because of the gcc behavior. We would also get smaller code and faster compile time, which does not get an error, but leads to code bloat at -O0 Here's another example from /usr/include/math.h # define signbit(x) \ (sizeof (x) == sizeof (float) \ ? __signbitf (x) \ : sizeof (x) == sizeof (double) \ ? __signbit (x) : __signbitl (x)) ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ Open64-devel mailing list Open64-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open64-devel