I've had to use the following patch for sci-libs/cln to compile it with gcc 4.5: ----------------------- diff -Naur cln-1.3.1.orig/autoconf/intparam.c cln-1.3.1/autoconf/intparam.c --- cln-1.3.1.orig/autoconf/intparam.c 2009-05-10 22:32:30.000000000 +0200 +++ cln-1.3.1/autoconf/intparam.c 2010-04-23 00:39:35.652967321 +0200 @@ -498,7 +498,7 @@ void main9(void) { #define get_endian(type,typestr,type_bitsize) \ { if (type_bitsize == uchar_bitsize * sizeof(type)) \ - { auto union { uchar einzeln[sizeof(type)]; type gesamt; } x; \ + { union { uchar einzeln[sizeof(type)]; type gesamt; } x; \ int i,j; \ boolean big_endian = TRUE; \ boolean little_endian = TRUE; \ @@ -540,7 +540,7 @@ } long get_stack_direction(void) - { auto char dummy; + { char dummy; static char* dummyaddr = (char*)0; if (!(dummyaddr == (char*)0)) { return (&dummy) - dummyaddr; } ----------------------- Reproducible: Always Steps to Reproduce: 1. 2. 3.
Created attachment 229375 [details, diff] no_auto.patch Patch to compile cln with gcc 4.5.
What was the error exactly ? Any idea, if it's incorrect syntax or a compiler bug ?
It's incorrect syntax. I don't know what that auto should be for and a quick web-search has brought up something about that. The only thing I know, is that auto might become a new kewyword in c++0x, so maybe that the reason gcc 4.5 now throws an error for it. Maybe it was just ignored before, anyway it isn't a valid C or C++ keyword as used in that code fragment.
s/something/nothing/
I didn't encounter any problems while compiling sci-libs/cln-1.3.1 with gcc-4.5.0 Please attach your build.log and emerge --info Best regards, Kacper Kowalik
Maybe you I've got it because I'm using -std=c++0x whenever possible. I can't reproduce it currently as the machine in question (a slow beagleboard) compiles other stuff for the next days ;) But as I've said, that auto is just useless and wrong.
-std=gnu++0x
(In reply to comment #7) > -std=gnu++0x That's not sane flag, you are enforcing standard that is not yet exactly defined. It's highly experimental. gnu++0x GNU dialect of -std=c++0x. This option enables experimental features that may be removed in future versions of GCC. @sci-mathematics: sorry for the noise @Rafał: please do not assing bug missing essential info to maintainers, thanks
I've written that bug because the source in question contains an invalid keyword. Thats even true for std-c. At least thats my knowledge. Anyway, I will submit the patch upstream...
(In reply to comment #9) > Anyway, I will submit the patch upstream... Yup, that's the best course of action. Sorry, I should've suggested it right away. Best regards, Kacper Kowalik
(In reply to comment #8) > @Rafał: please do not assing bug missing essential info to maintainers, thanks > On one hand - duly noted. On the other - it did look sane and if it really is incorrect syntax, it was (to a point) a valid bug.
I have to correct me. It is valid C (at least it's in the C99-Spec) but I've never seen that before. This auto is just what almost every c-compiler does by default and is a nop at least in gcc. But it is in conflict with c++0x and I'm wondering why I've got the error as I've specified -std=gnu++0x in the CXXFLAGS only. So either that .c is compiled with g++ or something adds CXXFLAGS to CFLAGS or something other happens. Will check that later.