Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 317449 - sci-libs/cln: fix for gcc 4.5
Summary: sci-libs/cln: fix for gcc 4.5
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Science Mathematics related packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-27 10:42 UTC by Alexander Holler
Modified: 2010-04-27 20:02 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
no_auto.patch (no_auto.patch,1.09 KB, patch)
2010-04-27 10:46 UTC, Alexander Holler
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Holler 2010-04-27 10:42:06 UTC
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.
Comment 1 Alexander Holler 2010-04-27 10:46:10 UTC
Created attachment 229375 [details, diff]
no_auto.patch

Patch to compile cln with gcc 4.5.
Comment 2 Rafał Mużyło 2010-04-27 10:53:47 UTC
What was the error exactly ?
Any idea, if it's incorrect syntax or a compiler bug ?
Comment 3 Alexander Holler 2010-04-27 11:03:15 UTC
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.

Comment 4 Alexander Holler 2010-04-27 11:03:39 UTC
s/something/nothing/
Comment 5 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2010-04-27 11:04:24 UTC
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
Comment 6 Alexander Holler 2010-04-27 11:09:39 UTC
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.
Comment 7 Alexander Holler 2010-04-27 11:10:17 UTC
-std=gnu++0x
Comment 8 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2010-04-27 11:17:31 UTC
(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
Comment 9 Alexander Holler 2010-04-27 11:23:57 UTC
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...
Comment 10 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2010-04-27 11:27:12 UTC
(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
Comment 11 Rafał Mużyło 2010-04-27 15:48:40 UTC
(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.
Comment 12 Alexander Holler 2010-04-27 20:02:03 UTC
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.