error: expected ')' before '*' token -- What is this ?

Discussion in 'C Programming' started by Ram Prasad, Jul 31, 2007.

  1. Ram  Prasad

    Ram Prasad Guest

    I am trying to write a simple libspf2 plugin code for my postfix
    ( milter)
    I am getting this unhelpful error message when I try to compile

    gcc -g1 -Wall -I/usr/local/include/spf2 -I. -c mfunc.c
    In file included from mfunc.c:1:
    mfunc.c:42: error: expected ')' before '*' token
    make: *** [mfunc.o] Error 1

    my mfunc.c has on the line 42
    -----------------------
    .. . . . .
    SPF_result_t spfcheck_s(SPF_request_t *ecm_spf_request, char* ip,
    char* helo, char* sender) {
    SPF_response_t *spf_response = NULL;
    SPF_result_t t;
    SPF_request_set_ipv4_str( ecm_spf_request, ip );
    SPF_request_set_helo_dom( ecm_spf_request, helo );
    SPF_request_set_env_from( ecm_spf_request, sender );
    SPF_request_query_mailfrom(ecm_spf_request, &spf_response);
    t = SPF_response_result(spf_response);
    SPF_response_free(spf_response);
    return t;
    }

    .. . . . .




    So what could be the error ?


    Thanks
    Ram

    PS:
    Note to Spammers: Go ahead , send me spam

    http://ecm.netcore.co.in/spamtrap.html
     
    Ram Prasad, Jul 31, 2007
    #1
    1. Advertising

  2. Ram  Prasad

    Richard Guest

    Ram Prasad <> writes:

    > I am trying to write a simple libspf2 plugin code for my postfix
    > ( milter)
    > I am getting this unhelpful error message when I try to compile
    >
    > gcc -g1 -Wall -I/usr/local/include/spf2 -I. -c mfunc.c
    > In file included from mfunc.c:1:
    > mfunc.c:42: error: expected ')' before '*' token
    > make: *** [mfunc.o] Error 1
    >
    > my mfunc.c has on the line 42
    > -----------------------
    > . . . . .
    > SPF_result_t spfcheck_s(SPF_request_t *ecm_spf_request, char* ip,
    > char* helo, char* sender) {
    > SPF_response_t *spf_response = NULL;
    > SPF_result_t t;
    > SPF_request_set_ipv4_str( ecm_spf_request, ip );
    > SPF_request_set_helo_dom( ecm_spf_request, helo );
    > SPF_request_set_env_from( ecm_spf_request, sender );
    > SPF_request_query_mailfrom(ecm_spf_request, &spf_response);
    > t = SPF_response_result(spf_response);
    > SPF_response_free(spf_response);
    > return t;
    > }
    >
    > . . . . .
    >
    >
    >
    >
    > So what could be the error ?


    Post all the code in that file and then "line 42" will be in context. It
    isn't even apparent from above what IS on line 42. "----"? ". . . "? or
    SPF_ ?
     
    Richard, Jul 31, 2007
    #2
    1. Advertising

  3. Ram  Prasad

    Ram Prasad Guest

    >
    > Post all the code in that file and then "line 42" will be in context. It
    > isn't even apparent from above what IS on line 42. "----"? ". . . "? or
    > SPF_ ?



    The file is here
    ----
    #include "mdef.h"
    FILE* LOGFILE;




    /*
    * Opens file ( /var/log/milter.log ) for debug log
    * any milter code can print to log file using addlog function
    */
    void opendbglog(void){
    LOGFILE=NULL;
    LOGFILE=fopen(LOGFILENAME,"a");
    if(LOGFILE==NULL){
    fprintf(stderr,"Couldnot open logfile\n");
    exit(1);
    }
    fprintf(LOGFILE,"opened logfile\n");
    setvbuf(LOGFILE, (char *)NULL, _IONBF, 0);
    }



    /*
    * Debug function
    * using va_args for number of args
    *
    * usage addlog(number_of_arguments,arg1,arg2,arg3,arg4...)
    */

    void addlog(int num_args, ... ) {
    va_list ap;
    if(LOGFILE == NULL ) return;
    va_start(ap,num_args);
    while(num_args--) fprintf(LOGFILE," %s ", va_arg(ap,char*));
    va_end(ap);
    fprintf(LOGFILE,"\n");
    return;
    }


    SPF_result_t spfcheck_s(SPF_request_t *ecm_spf_request, char* ip,
    char* helo, char* sender) {
    SPF_response_t *spf_response = NULL;
    SPF_result_t t;
    SPF_request_set_ipv4_str( ecm_spf_request, ip );
    SPF_request_set_helo_dom( ecm_spf_request, helo );
    SPF_request_set_env_from( ecm_spf_request, sender );
    SPF_request_query_mailfrom(ecm_spf_request, &spf_response);
    t = SPF_response_result(spf_response);
    SPF_response_free(spf_response);
    return t;
    }
     
    Ram Prasad, Jul 31, 2007
    #3
  4. Ram  Prasad

    Richard Guest

    Ram Prasad <> writes:

    >>
    >> Post all the code in that file and then "line 42" will be in context. It
    >> isn't even apparent from above what IS on line 42. "----"? ". . . "? or
    >> SPF_ ?

    >
    >
    > The file is here
    > ----


    *snip*

    I loaded into a syntax hilited editor and saw no obvious syntax errors -
    I cant see anything manually despite a quick scan, I guess there might
    be troubles in mdef.h where I assume you are including <stdio.h> amongst
    other things. Without it one cant really tell.

    Try commenting blocks out and then reinstating them to pinpoint the
    error.
     
    Richard, Jul 31, 2007
    #4
  5. Ram  Prasad

    santosh Guest

    Ram Prasad wrote:

    Please don't remove attribution lines.
    [Richard wrote]

    >> Post all the code in that file and then "line 42" will be in context. It
    >> isn't even apparent from above what IS on line 42. "----"? ". . . "? or
    >> SPF_ ?

    >
    >
    > The file is here
    > ----
    > #include "mdef.h"
    > FILE* LOGFILE;


    It idiomatic in C to reserve all uppercase names for macros.

    > /*
    > * Opens file ( /var/log/milter.log ) for debug log
    > * any milter code can print to log file using addlog function
    > */
    > void opendbglog(void){
    > LOGFILE=NULL;
    > LOGFILE=fopen(LOGFILENAME,"a");
    > if(LOGFILE==NULL){
    > fprintf(stderr,"Couldnot open logfile\n");
    > exit(1);
    > }
    > fprintf(LOGFILE,"opened logfile\n");
    > setvbuf(LOGFILE, (char *)NULL, _IONBF, 0);


    The cast is not needed.

    > }
    >
    > /*
    > * Debug function
    > * using va_args for number of args
    > * usage addlog(number_of_arguments,arg1,arg2,arg3,arg4...)
    > */
    > void addlog(int num_args, ... ) {
    > va_list ap;
    > if(LOGFILE == NULL ) return;
    > va_start(ap,num_args);
    > while(num_args--) fprintf(LOGFILE," %s ", va_arg(ap,char*));
    > va_end(ap);
    > fprintf(LOGFILE,"\n");
    > return;
    > }
    >
    > SPF_result_t spfcheck_s(SPF_request_t *ecm_spf_request, char* ip,
    > char* helo, char* sender) {
    > SPF_response_t *spf_response = NULL;
    > SPF_result_t t;
    > SPF_request_set_ipv4_str( ecm_spf_request, ip );
    > SPF_request_set_helo_dom( ecm_spf_request, helo );
    > SPF_request_set_env_from( ecm_spf_request, sender );
    > SPF_request_query_mailfrom(ecm_spf_request, &spf_response);
    > t = SPF_response_result(spf_response);
    > SPF_response_free(spf_response);
    > return t;
    > }


    We'll need to see the definitions for SPF_*_t types. I can't spot anything
    amiss, just looking at the above code.
     
    santosh, Jul 31, 2007
    #5
  6. Ram  Prasad

    Eric Sosman Guest

    Ram Prasad wrote:
    >> Post all the code in that file and then "line 42" will be in context. It
    >> isn't even apparent from above what IS on line 42. "----"? ". . . "? or
    >> SPF_ ?

    >
    >
    > The file is here
    > [...]
    > SPF_result_t spfcheck_s(SPF_request_t *ecm_spf_request, char* ip,
    > char* helo, char* sender) {


    Just a guess: Does the header file (which you didn't show)
    declare a type named `SPF_request_t', or does it declare something
    slightly different like `SPF_Request_t' or `SPF_request'? (Or
    does it declare `struct SPF_request_t' but not `SPF_request_t'?)

    --
    Eric Sosman
    lid
     
    Eric Sosman, Jul 31, 2007
    #6
  7. Ram  Prasad

    Ram Prasad Guest

    On Jul 31, 5:25 pm, Eric Sosman <> wrote:
    > Ram Prasad wrote:
    > >> Post all the code in that file and then "line 42" will be in context. It
    > >> isn't even apparent from above what IS on line 42. "----"? ". . . "? or
    > >> SPF_ ?

    >
    > > The file is here
    > > [...]
    > > SPF_result_t spfcheck_s(SPF_request_t *ecm_spf_request, char* ip,
    > > char* helo, char* sender) {

    >
    > Just a guess: Does the header file (which you didn't show)
    > declare a type named `SPF_request_t', or does it declare something
    > slightly different like `SPF_Request_t' or `SPF_request'? (Or
    > does it declare `struct SPF_request_t' but not `SPF_request_t'?)
    >
    > --
    > Eric Sosman
    >


    I am not much of a cprogrammer myself , ( been doing perl all this
    while)
    But I am willing to improve

    Here you go, this is my mdef.h sorry for not posting all src code in
    first place.
    The spf header files come from standard libspf2-devel rpm

    -------
    #ifndef MDEF_H
    #include "milterconfig.h"
    #define MDEF_H 1
    #include "milterconfig.h"

    #include <time.h>
    #include <errno.h>
    #include <getopt.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <ctype.h>
    #include <string.h>
    #include <sysexits.h>
    #include <stdarg.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <unistd.h>
    #include <syslog.h>
    #include <regex.h> /* Provides regular expression matching */
    #include <strings.h> /* String utillity functions */
    #include <libmilter/mfapi.h>
    #include <netinet/in.h>
    # include <inttypes.h>
    # include <string.h> /* strstr / strdup */
    # include <sys/socket.h> /* inet_ functions / structs */
    # include <netinet/in.h> /* inet_ functions / structs */
    # include <arpa/inet.h> /* in_addr struct */
    # include <unistd.h>
    # include <spf.h>

    #ifndef true
    # define false 0
    # define true 1
    #endif /* ! true */



    struct blist {
    char *key;
    };
    typedef struct blist bl;


    struct ecm_list_stru {
    int count;
    bl *list;
    };

    typedef struct ecm_list_stru ecml;



    #define BLACKLIST_FILE "blacklist.txt"
    /* Global functions */
    void opendbglog(void);
    void addlog(int num_args, ... ) ;
    SPF_result_t spfcheck_s(SPF_request_t *ecm_spf_request,char* ip, char*
    helo, char* sender);
    int compbl(const void *m1, const void *m2);
    int init_ecml(ecml* el,char *filename);
    int searchlist(ecml el,char *needle);


    /* All definitions here */
    #define LOGFILENAME "/var/log/milter.log"
    #define MLOGLEVEL 5 /* level of error logs generation
    0-5 */
    #define MAXFROMSIZE 200
    #define SAMPLE 1


    /* some std structures */


    struct mlfiPriv
    {
    #ifdef SAMPLE
    char *mlfi_fname;
    FILE *mlfi_fp;
    #endif
    #ifdef SPFCHECK
    char mfrom[MAXFROMSIZE];
    #endif
    };

    #define MLFIPRIV ((struct mlfiPriv *) smfi_getpriv(ctx))


    #endif
     
    Ram Prasad, Jul 31, 2007
    #7
  8. Ram  Prasad

    Lew Pitcher Guest

    On Jul 31, 6:31 am, Ram Prasad <> wrote:
    > I am trying to write a simple libspf2 plugin code for my postfix
    > ( milter)
    > I am getting this unhelpful error message when I try to compile
    >
    > gcc -g1 -Wall -I/usr/local/include/spf2 -I. -c mfunc.c
    > In file included from mfunc.c:1:
    > mfunc.c:42: error: expected ')' before '*' token
    > make: *** [mfunc.o] Error 1
    >
    > my mfunc.c has on the line 42
    > -----------------------
    > . . . . .
    > SPF_result_t spfcheck_s(SPF_request_t *ecm_spf_request, char* ip,
    > char* helo, char* sender) {
    > SPF_response_t *spf_response = NULL;
    > SPF_result_t t;
    > SPF_request_set_ipv4_str( ecm_spf_request, ip );
    > SPF_request_set_helo_dom( ecm_spf_request, helo );
    > SPF_request_set_env_from( ecm_spf_request, sender );
    > SPF_request_query_mailfrom(ecm_spf_request, &spf_response);
    > t = SPF_response_result(spf_response);
    > SPF_response_free(spf_response);
    > return t;
    >
    > }
    >
    > . . . . .
    >
    > So what could be the error ?


    Well, the message says that the syntax error occurred
    In file included from mfunc.c:1
    which (in a later post) appears to be your
    #include "mdef.h"

    Otherwise, your code does not appear to contain any syntax errors that
    would be detected and reported as
    mfunc.c:42: error: expected ')' before '*' token
    so I'm guessing that your mdef.h header has the syntax error.

    HTH
    --
    Lew
     
    Lew Pitcher, Jul 31, 2007
    #8
  9. Ram  Prasad

    Richard Guest

    Ram Prasad <> writes:

    > On Jul 31, 5:25 pm, Eric Sosman <> wrote:
    >> Ram Prasad wrote:
    >> >> Post all the code in that file and then "line 42" will be in context. It
    >> >> isn't even apparent from above what IS on line 42. "----"? ". . . "? or
    >> >> SPF_ ?

    >>
    >> > The file is here
    >> > [...]
    >> > SPF_result_t spfcheck_s(SPF_request_t *ecm_spf_request, char* ip,
    >> > char* helo, char* sender) {

    >>
    >> Just a guess: Does the header file (which you didn't show)
    >> declare a type named `SPF_request_t', or does it declare something
    >> slightly different like `SPF_Request_t' or `SPF_request'? (Or
    >> does it declare `struct SPF_request_t' but not `SPF_request_t'?)
    >>
    >> --
    >> Eric Sosman
    >>

    >
    > I am not much of a cprogrammer myself , ( been doing perl all this
    > while)
    > But I am willing to improve
    >
    > Here you go, this is my mdef.h sorry for not posting all src code in
    > first place.


    And you still haven't. There are other includes that people here
    probably wont have. milterconfig.h for a start.

    I suspect it would be quicker for you to comment/uncomment bit by bit to
    find your error yourself.

    btw, you include milterconfig.h twice for some reason.
     
    Richard, Jul 31, 2007
    #9
  10. Ram  Prasad

    santosh Guest

    Ram Prasad wrote:

    > On Jul 31, 5:25 pm, Eric Sosman <> wrote:
    >> Ram Prasad wrote:
    >> >> Post all the code in that file and then "line 42" will be in context.
    >> >> It isn't even apparent from above what IS on line 42. "----"? ". . .
    >> >> "? or SPF_ ?

    >>
    >> > The file is here
    >> > [...]
    >> > SPF_result_t spfcheck_s(SPF_request_t *ecm_spf_request, char* ip,
    >> > char* helo, char* sender) {

    >>
    >> Just a guess: Does the header file (which you didn't show)
    >> declare a type named `SPF_request_t', or does it declare something
    >> slightly different like `SPF_Request_t' or `SPF_request'? (Or
    >> does it declare `struct SPF_request_t' but not `SPF_request_t'?)


    >
    > I am not much of a cprogrammer myself , ( been doing perl all this
    > while) But I am willing to improve
    >
    > Here you go, this is my mdef.h sorry for not posting all src code in
    > first place. The spf header files come from standard libspf2-devel rpm


    <snip header>

    We still need the definitions for all the SPF_*_t types, particularly,
    SPF_result_t and SPF_request_t.
     
    santosh, Jul 31, 2007
    #10
  11. Ram  Prasad

    Ram Prasad Guest

    Ram Prasad, Jul 31, 2007
    #11
  12. Ram  Prasad

    Mark Bluemel Guest

    Ram Prasad wrote:
    >>We still need the definitions for all the SPF_*_t types, particularly,
    >>SPF_result_t and SPF_request_t.

    >
    >
    > But these are standard header files


    No - they are part of a specific package. Nothing standard about them as
    far as the C language goes.

    I do wonder whether you'd get better help about developing with this
    package by posting to a forum specifically for it, rather than a general
    C newsgroup. Looking here <http://www.libspf2.org/support.html> suggests
    some possibilities.
     
    Mark Bluemel, Jul 31, 2007
    #12
  13. Ram  Prasad

    Ram Prasad Guest

    On Jul 31, 7:33 pm, Mark Bluemel <> wrote:
    > Ram Prasad wrote:
    > >>We still need the definitions for all the SPF_*_t types, particularly,
    > >>SPF_result_t and SPF_request_t.

    >
    > > But these are standard header files

    >
    > No - they are part of a specific package. Nothing standard about them as
    > far as the C language goes.
    >
    > I do wonder whether you'd get better help about developing with this
    > package by posting to a forum specifically for it, rather than a general
    > C newsgroup. Looking here <http://www.libspf2.org/support.html> suggests
    > some possibilities.


    But that is not a group of programmers. I simply wanted to know what
    this error means
    error: expected ')' before '*' token

    Definetly it loooks like a syntax error , but there is absolutely no
    error on that line
    If I comment out the entire function and its declaration , then I dont
    get this error. I just declare this function , without even defining
    the code for it and gcc gives me this stupid error
     
    Ram Prasad, Jul 31, 2007
    #13
  14. Ram  Prasad

    santosh Guest

    Ram Prasad wrote:

    > On Jul 31, 7:33 pm, Mark Bluemel <> wrote:
    >> Ram Prasad wrote:
    >> >>We still need the definitions for all the SPF_*_t types, particularly,
    >> >>SPF_result_t and SPF_request_t.

    >>
    >> > But these are standard header files

    >>
    >> No - they are part of a specific package. Nothing standard about them as
    >> far as the C language goes.
    >>
    >> I do wonder whether you'd get better help about developing with this
    >> package by posting to a forum specifically for it, rather than a general
    >> C newsgroup. Looking here <http://www.libspf2.org/support.html> suggests
    >> some possibilities.

    >
    > But that is not a group of programmers. I simply wanted to know what
    > this error means
    > error: expected ')' before '*' token
    >
    > Definetly it loooks like a syntax error , but there is absolutely no
    > error on that line
    > If I comment out the entire function and its declaration , then I dont
    > get this error. I just declare this function , without even defining
    > the code for it and gcc gives me this stupid error


    Find out the definition for all the SPF_*_types in the function declaration
    and definition. What do they resolve into? Do you compile in ISO C
    conforming mode or in someother mode? Is the code GNU C specific? If not,
    try compiling with another compiler like Intel' or MSVC.

    It's highly unlikely to a gcc bug. There must be some syntax error in your
    code and header files. Try to compile a minimal program that still exhibits
    the error. You can do that by leaving out stuff that are not absolutely
    necessary for successful compilation or for exhibiting the error.
     
    santosh, Jul 31, 2007
    #14
  15. Ram  Prasad

    Mark Bluemel Guest

    Ram Prasad wrote:
    > On Jul 31, 7:33 pm, Mark Bluemel <> wrote:
    >
    >>Ram Prasad wrote:
    >>
    >>>>We still need the definitions for all the SPF_*_t types, particularly,
    >>>>SPF_result_t and SPF_request_t.

    >>
    >>>But these are standard header files

    >>
    >>No - they are part of a specific package. Nothing standard about them as
    >>far as the C language goes.
    >>
    >>I do wonder whether you'd get better help about developing with this
    >>package by posting to a forum specifically for it, rather than a general
    >>C newsgroup. Looking here <http://www.libspf2.org/support.html> suggests
    >>some possibilities.

    >
    >
    > But that is not a group of programmers.


    It very like is, and it's probably a group of people who have developed
    with this library and these header files. But if you don't want my
    advice it hasn't cost you anything.

    > I simply wanted to know what
    > this error means
    > error: expected ')' before '*' token


    It means the compiler expected something in parentheses to have been
    completed, and the closing parenthesis supplied, before a '*' on line 42.

    > Definetly it loooks like a syntax error , but there is absolutely no
    > error on that line


    Have you examined the code which the compiler is compiling?

    I suggest you run the gcc compiler with whatever option will show you
    the results of the precompiler - perhaps "-E". Examine that code and
    work backwards.
     
    Mark Bluemel, Jul 31, 2007
    #15
  16. Ram  Prasad

    Al Balmer Guest

    On Tue, 31 Jul 2007 03:31:47 -0700, Ram Prasad
    <> wrote:

    >I am trying to write a simple libspf2 plugin code for my postfix
    >( milter)
    >I am getting this unhelpful error message when I try to compile
    >
    >gcc -g1 -Wall -I/usr/local/include/spf2 -I. -c mfunc.c
    >In file included from mfunc.c:1:
    >mfunc.c:42: error: expected ')' before '*' token
    >make: *** [mfunc.o] Error 1
    >
    >my mfunc.c has on the line 42
    >-----------------------
    >. . . . .
    >SPF_result_t spfcheck_s(SPF_request_t *ecm_spf_request, char* ip,
    >char* helo, char* sender) {


    We still don't have enough information, but making some assumptions
    and wild guesses, I suspect that the compiler is not recognizing
    "SPF_request_t". Check it's definition, make sure the definition is
    visible to the code with the error, and make sure you spelled
    everything correctly. Do the same for all the strange types being
    used.

    --
    Al Balmer
    Sun City, AZ
     
    Al Balmer, Jul 31, 2007
    #16
  17. In article <>,
    Ram Prasad <> wrote:

    >gcc -g1 -Wall -I/usr/local/include/spf2 -I. -c mfunc.c
    >In file included from mfunc.c:1:
    >mfunc.c:42: error: expected ')' before '*' token


    That is a very strange error message. If the files you have posted
    are right, mfunc.c is not included in mfunc.c at line 1. Have you
    omitted part of the error message? Or do you have a file mdef.h that
    contains preprocessor output from some version of mfunc.c (perhaps
    in /usr/local/include/spf2)? Check that the files all contain what
    you expect them to.

    -- Richard
    --
    "Consideration shall be given to the need for as many as 32 characters
    in some alphabets" - X3.4, 1963.
     
    Richard Tobin, Jul 31, 2007
    #17
  18. On Jul 31, 6:31 am, Ram Prasad <> wrote:
    > I am trying to write a simple libspf2 plugin code for my postfix
    > ( milter)
    > I am getting this unhelpful error message when I try to compile
    >
    > gcc -g1 -Wall -I/usr/local/include/spf2 -I. -c mfunc.c
    > In file included from mfunc.c:1:
    > mfunc.c:42: error: expected ')' before '*' token
    > make: *** [mfunc.o] Error 1




    I usually get this error when I mess up syntax (e.g. miss
    a semicolon) or a header file has not been included properly.
    Looks like things like SPF_request_t are not being recognized.
    Make sure that the SPF.h (or whatever) files are included
    and found (a message like "file SPF.h not found" is easy
    to miss).

    - William Hughes

    >
    > my mfunc.c has on the line 42
    > -----------------------
    > . . . . .
    > SPF_result_t spfcheck_s(SPF_request_t *ecm_spf_request, char* ip,
    > char* helo, char* sender) {
    > SPF_response_t *spf_response = NULL;
    > SPF_result_t t;
    > SPF_request_set_ipv4_str( ecm_spf_request, ip );
    > SPF_request_set_helo_dom( ecm_spf_request, helo );
    > SPF_request_set_env_from( ecm_spf_request, sender );
    > SPF_request_query_mailfrom(ecm_spf_request, &spf_response);
    > t = SPF_response_result(spf_response);
    > SPF_response_free(spf_response);
    > return t;
    >
    > }
    >
    > . . . . .
    >
    > So what could be the error ?
    >
    > Thanks
    > Ram
    >
    > PS:
    > Note to Spammers: Go ahead , send me spam
    > ://ecm.netcore.co.in/spamtrap.html
     
    William Hughes, Jul 31, 2007
    #18
  19. Ram  Prasad

    jacob navia Guest

    Al Balmer wrote:
    > On Tue, 31 Jul 2007 03:31:47 -0700, Ram Prasad
    > <> wrote:
    >
    >> I am trying to write a simple libspf2 plugin code for my postfix
    >> ( milter)
    >> I am getting this unhelpful error message when I try to compile
    >>
    >> gcc -g1 -Wall -I/usr/local/include/spf2 -I. -c mfunc.c
    >> In file included from mfunc.c:1:
    >> mfunc.c:42: error: expected ')' before '*' token
    >> make: *** [mfunc.o] Error 1
    >>
    >> my mfunc.c has on the line 42
    >> -----------------------
    >> . . . . .
    >> SPF_result_t spfcheck_s(SPF_request_t *ecm_spf_request, char* ip,
    >> char* helo, char* sender) {

    >
    > We still don't have enough information, but making some assumptions
    > and wild guesses, I suspect that the compiler is not recognizing
    > "SPF_request_t". Check it's definition, make sure the definition is
    > visible to the code with the error, and make sure you spelled
    > everything correctly. Do the same for all the strange types being
    > used.
    >


    I thought about the same problem but then, I saw that in that case it
    wouldn't have recognized "SPF_result" either...

    and canceled my post.
     
    jacob navia, Jul 31, 2007
    #19
  20. Ram  Prasad

    John Bode Guest

    On Jul 31, 5:31 am, Ram Prasad <> wrote:
    > I am trying to write a simple libspf2 plugin code for my postfix
    > ( milter)
    > I am getting this unhelpful error message when I try to compile
    >
    > gcc -g1 -Wall -I/usr/local/include/spf2 -I. -c mfunc.c
    > In file included from mfunc.c:1:
    > mfunc.c:42: error: expected ')' before '*' token
    > make: *** [mfunc.o] Error 1
    >
    > my mfunc.c has on the line 42
    > -----------------------
    > . . . . .
    > SPF_result_t spfcheck_s(SPF_request_t *ecm_spf_request, char* ip,
    > char* helo, char* sender) {


    [snip]

    Based on what you've posted here, SPF_request_t has not been properly
    defined at this point; either you haven't #included the right header
    file, or the header file has a syntax error in it.
     
    John Bode, Jul 31, 2007
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bubzilla
    Replies:
    2
    Views:
    938
    bubzilla
    Sep 25, 2006
  2. andrew browning
    Replies:
    16
    Views:
    15,488
    Artie Gold
    Mar 13, 2006
  3. =?Utf-8?B?Y2FzaGRlc2ttYWM=?=

    This is an unexpected token. The expected token is 'NAME'

    =?Utf-8?B?Y2FzaGRlc2ttYWM=?=, Jul 13, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    787
    =?Utf-8?B?Y2FzaGRlc2ttYWM=?=
    Jul 13, 2007
  4. Replies:
    5
    Views:
    23,706
  5. ramif_47
    Replies:
    7
    Views:
    956
    ramif_47
    Nov 5, 2007
Loading...

Share This Page