You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm forwarding this to Trac so it doesn't get lost. The original problem
manifested itself on the openbsd smoker in the gcc compile farm, but is
likely more general than that.
--
Andy Dougherty doughera@lafayette.edu
---------- Forwarded message ----------
Date: Mon, 25 Jul 2011 19:53:31 -0400 (EDT)
From: Andy Dougherty <doughera@lafayette.edu>
To: Jonathan "Duke" Leto <jonathan@leto.net>
Cc: parrot-dev <parrot-dev@lists.parrot.org>
Subject: Re: compile error on openbsd with g++
On Sat, 23 Jul 2011, Andy Dougherty wrote:
> On Fri, 22 Jul 2011, Jonathan "Duke" Leto wrote:
>
> > gcc (GCC) 3.3.5 (propolice)
> > On Fri, Jul 22, 2011 at 10:49 AM, Jonathan "Duke" Leto
> > <jonathan@leto.net> wrote:
> > > Howdy,
> > >
> > > Just got the openbsd smoker in the farm working again, and it hit a
> > > compile error:
> > >
> > > https://gist.github.com/1099956
>
> Without seeing both the output of Configure.pl --verbose and the
> preprocessed output of src/string/api.c, it's hard to be sure, but this
> looks like the sort of thing you get when parrot's detection of attributes
> is wrong.
>
> In particular, the gcc-3.3/HASATTRIBUTE_UNUSED combination is tricky: It
> works in gcc-3.3, but fails in g++-3.3.
I haven't tested this at all, but I suspect that the issue is that the
Configure.pl probe doesn't use the attribute in the same way as parrot
does. (The inline probe has the same problem. See TT #1943).
It's likely that a rather trivial patch like the one below will fix this
immediate problem, but since my last 2 attempts to do something useful for
attribute detection were rejected, I'm unwilling to work any harder at it.
diff --git a/config/auto/attributes/test_c.in b/config/auto/attributes/test_c.in
index eb5262c..896da8b 100644
--- a/config/auto/attributes/test_c.in
+++ b/config/auto/attributes/test_c.in
@@ -42,7 +42,7 @@ coldfunc(int x);
static int
-useless(void) { int x __attribute__unused__; return 0; }
+useless(int x __attribute__unused__) { int y __attribute__unused__; return 0; }
/* as long as the file compiles, everything is okay */
--
Andy Dougherty doughera@lafayette.edu
index eb5262c..896da8b 100644
--- a/config/auto/attributes/test_c.in+++ b/config/auto/attributes/test_c.in@@ -42,7 +42,7 @@ coldfunc(int x);
static int
-useless(void) { int x **attribute__unused**; return 0; }+useless(int x **attribute__unused**) { int y **attribute__unused**; return 0; }
/\* as long as the file compiles, everything is okay */
I have converted Andy Dougherty's patch to an attachment. I tried it out on both Linux/i386 and Darwin/PPC with no harm; all tests PASS. However, in both cases I was using gcc or g++ 4+. So, it still needs to be tested for the case for which it was designed.
Originally http://trac.parrot.org/parrot/ticket/2164
The text was updated successfully, but these errors were encountered: