guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guile 1.8.2 Compile Error [GAH]


From: Kevin Brott
Subject: Re: Guile 1.8.2 Compile Error [GAH]
Date: Mon, 12 Nov 2007 15:39:14 -0800

Bollux, let's try that again...

On Tue, 2007-11-13 at 00:14 +0100, Ludovic Courtès wrote:
..
> This is the second line of the typedef for `scm_t_c_hook_function'.  Can
> you try compiling *only* that typedef?  And then this:
> 
>   typedef void * (* foo_t) (void *, void *);
> 
> Then:
> 
>   typedef void (* foo_t) (void *, void *);
> 

All three compile without error if I wrap them in the usual main() {...}

> The `scm_t_c_hook_function' seems perfectly valid to me so if the
> compiler chokes, then I'm afraid it's a broken compiler.

I'd agree - except this is the only code it's broken on, and I went
through freshly compiled versions of gcc 3.3.6, 3.4.6, 4.0.4, 4.1.2, and
4.2.2 - and all of them have the same basic problem. FWIW - I couldn't
get 1.6.8 to compile until I had a working gcc 4.0.4, and was using
1.4.1 - which has always compiled/worked fine.

> So now the typedef itself doesn't yield any error?

not on it's own, no.

> 
> Did you prepend "#define SCM_API extern"?  It will fail without this.
> 

Nope - you got the code snippets I used.

> > ---cut---
> > 41:
> > 42: typedef void *(*scm_t_c_hook_function) (void *hook_data,
> > 43*                                         void *func_data,
> > 44:                                         void *data);
> > 45:
> > 46: typedef struct scm_t_c_hook_entry {
> > 47:   struct scm_t_c_hook_entry *next;
> > 48*   scm_t_c_hook_function func;
> > 49:   void *data;
> > 50: } scm_t_c_hook_entry;
> > 51...60
> > 61: SCM_API void scm_c_hook_add (scm_t_c_hook *hook,
> > 62*                              scm_t_c_hook_function func,
> > 63*                              void *func_data,
> > 64:                              int appendp);
> > 65: SCM_API void scm_c_hook_remove (scm_t_c_hook *hook,
> > 66*                                 scm_t_c_hook_function func,
> > 67*                                 void *func_data);
> > 68:
> > ---cut---
> >
> > I get ...
> > test2.c:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before 
> > 'void'
> > test2.c:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before 
> > 'void'
> >
> > Which are the SCM_API declarations again.
> 
> Again, no error with the typedef?

nope.

> 
> > Suggestions, correction for a more valid / informative test?
> 
> If one of the above `foo_t' typedefs works, then you can try compiling
> this:
> 
>   extern void make_foo (void *x, foo_t function);
> 
---cut---
main()
{
extern void make_foo (void *x, foo_t function);
}
---cut---

# gcc -o evt evt.c 
evt.c: In function 'main':
evt.c:3: error: expected declaration specifiers or '...' before 'foo_t'

> Then maybe this:
> 
>   extern void make_foo (void *x, foo_t *function);
> 

Same error.

> This is all trial-and-error since I have no idea of what's wrong with
> this compiler.
> 
> I quickly browsed the bug database at gcc.gnu.org and failed to find
> anything related.  You might want to try that too...

Doing that - not having a lot of luck so far ...

Was wondering if it's a bad/missing fixincludes action in gcc ... but if
that were the case then I'd think a lot more stuff wouldn't compile
besides just guile 1.8.

-- 
#include <stddisclaimer.h>
/* Kevin Brott <address@hidden> 
 * Unix Systems Engineer - SA Group - Provtech
 * Providence Health Systems, Tigard, OR
 */


DISCLAIMER:
This message is intended for the sole use of the addressee, and may contain 
information that is privileged, confidential and exempt from disclosure under 
applicable law. If you are not the addressee you are hereby notified that you 
may not use, copy, disclose, or distribute to anyone the message or any 
information contained in the message. If you have received this message in 
error, please immediately advise the sender by reply email and delete this 
message.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]