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


From: Ludovic Courtès
Subject: Re: Guile 1.8.2 Compile Error
Date: Tue, 13 Nov 2007 00:14:40 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Hi,

"Kevin Brott" <address@hidden> writes:

> In file included from ../libguile/gc.h:27,
>                  from ../libguile.h:73,
>                  from discouraged.c:22:
> ./libguile/hooks.h:43: error: expected ';', ',' or ')' before '.' token

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 *);

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.

> Were you asking to just put the quoted code lines in a .c file and see
> what happens when I apply gcc to it, or were you looking for something
> more specific?

The former.

> In the hopes it's something simple -- if test.c is:
> ---cut---
>
>   typedef void  *(*scm_t_c_hook_function) (void *hook_data,
>                                            void *func_data,
>                                            void *data);
>
>   SCM_API void scm_c_hook_add (scm_t_c_hook *hook,
>                                scm_t_c_hook_function func,
>                                void *func_data,
>                                int appendp);
>
>   SCM_API void scm_c_hook_remove (scm_t_c_hook *hook,
>                                   scm_t_c_hook_function func,
>                                   void *func_data);
>
> ---cut---
>
> and I do gcc -o test test.c ... I get ...
>
> test.c:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before 
> 'void'
> test.c:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 
> 'void'
>
> Which are the SCM_API declarations.

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

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

> ---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?

> 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);

Then maybe this:

  extern void make_foo (void *x, foo_t *function);

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...

Thanks,
Ludovic.





reply via email to

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