unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: "Kevin Brott" <kevin.brott@providence.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Guile-User <guile-user@gnu.org>
Subject: Re: Guile 1.8.2 Compile Error
Date: Mon, 12 Nov 2007 15:30:03 -0800	[thread overview]
Message-ID: <1194910203.8243.6.camel@vanguard.or.providence.org> (raw)
In-Reply-To: <87hcjrgiov.fsf@chbouib.org>


On Tue, 2007-11-13 at 00:14 +0100, Ludovic Courtès wrote:
..
> > 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.
-- 
#include <stddisclaimer.h>
/* Kevin Brott <Kevin.Brott@Providence.org> 
 * Unix Systems Engineer - SA Group - Provtech
 * Providence Health Systems - 503-216-4703
 */


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.


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


  reply	other threads:[~2007-11-12 23:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1194888764.4167.13.camel@vanguard.or.providence.org>
     [not found] ` <87fxzbql1e.fsf@chbouib.org>
2007-11-12 21:37   ` Guile 1.8.2 Compile Error Kevin Brott
2007-11-12 23:14     ` Ludovic Courtès
2007-11-12 23:30       ` Kevin Brott [this message]
2007-11-12 23:39       ` Guile 1.8.2 Compile Error [GAH] Kevin Brott
2007-11-12 23:46         ` Kevin Brott
2007-11-12 23:51         ` Ludovic Courtès
2007-11-13  0:08           ` Kevin Brott
2007-11-13 19:00             ` Kevin Brott
2007-11-13 22:20               ` Ludovic Courtès
2007-11-13 23:05                 ` Kevin Brott
2007-11-14  0:39                   ` Neil Jerram
2007-11-14  1:29                     ` Kevin Brott
2007-11-14  1:54                       ` Kevin Brott
2007-11-14 13:35                     ` Ludovic Courtès
2007-11-14 17:59                       ` Kevin Brott
2007-11-14 18:37                         ` Kevin Brott
2007-11-15 20:50                       ` Neil Jerram
2007-11-16 16:50                         ` Ludovic Courtès
2007-11-26 21:26                           ` Neil Jerram
2007-09-13 15:26 Guile 1.8.2 Compile Error ericbambach1
2007-09-15  9:06 ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1194910203.8243.6.camel@vanguard.or.providence.org \
    --to=kevin.brott@providence.org \
    --cc=guile-user@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).