------- Comment #8 from pinskia at gcc dot gnu dot org 2006-04-23 20:21 ------- (In reply to comment #7) > I think this is a valid request. While random language extensions aren't > useful, > compatibility with C99 is. Maybe somebody else can comment on this...
There are a lot of differences between C and C++, this is just one of the differences. Another would be where the variable is done inside a for/if expression in that: int g(void); int f(void) { if (int t = g()) { int t = g()+1; } } is valid C but invalid C++ (though GCC gets it wrong for C++ but that is an already filed bug report). PR 27252 (aka PR 9278) is another example where C and C++ diff and in fact was just fixed for 4.2.0 for a bug report. These are just some examples of where C and C++ differ. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27235