Ticket #2164 (new bug)

Opened 3 years ago

Last modified 3 years ago

Error detecting attributes (g++-3.3)

Reported by: Andy Dougherty <doughera@…> Owned by:
Priority: normal Milestone: 2.11
Component: configure Version: 3.6.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:

Description

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

Attachments

tt2164.doughera.patch Download (440 bytes) - added by jkeenan 3 years ago.

Change History

Changed 3 years ago by doughera@…

This message has 0 attachment(s)

Changed 3 years ago by jkeenan

Changed 3 years ago by jkeenan

  • component changed from none to configure
  • type set to bug

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.

kid51

Note: See TracTickets for help on using tickets.