Parsing error!?

Discussion in 'C Programming' started by ArmedCoder, Oct 3, 2003.

  1. ArmedCoder

    ArmedCoder Guest

    Ok, i have this problem that is driving me nuts!

    I have a header file that has the function definition:
    landindp get_world_landind( worldp world );
    where landindp and worldp are pointers to structs.
    I keep getting errors saying "parse error before get_world_landind()"
    and "warning: data definition has no type or storage class"

    Now i have the landind.h file included, and landindp is defined as:
    typedef struct landind *landindp;

    and in landind.c
    struct landind
    {
    //insert code here
    } landind_;

    Any ideas why i would be getting this error? It seems to me that the
    struct is not being seen, but why?
     
    ArmedCoder, Oct 3, 2003
    #1
    1. Advertising

  2. ArmedCoder

    Mike Wahler Guest

    "ArmedCoder" <> wrote in message
    news:...
    > Ok, i have this problem that is driving me nuts!
    >
    > I have a header file that has the function definition:
    > landindp get_world_landind( worldp world );
    > where landindp and worldp are pointers to structs.
    > I keep getting errors saying "parse error before get_world_landind()"
    > and "warning: data definition has no type or storage class"
    >
    > Now i have the landind.h file included, and landindp is defined as:
    > typedef struct landind *landindp;
    >
    > and in landind.c
    > struct landind
    > {
    > //insert code here
    > } landind_;
    >
    > Any ideas why i would be getting this error? It seems to me that the
    > struct is not being seen, but why?


    Put together a small complete example program that
    demonstrates this error. Also show the contents
    of the #included header. Don't type it in, copy
    and paste it into your message.

    -Mike
     
    Mike Wahler, Oct 3, 2003
    #2
    1. Advertising

  3. ArmedCoder

    Ben Pfaff Guest

    (ArmedCoder) writes:

    > I have a header file that has the function definition:
    > landindp get_world_landind( worldp world );
    > where landindp and worldp are pointers to structs.
    > I keep getting errors saying "parse error before get_world_landind()"
    > and "warning: data definition has no type or storage class"


    Make sure that the declaration before that one is properly
    terminated with ; or }. If that doesn't help, try running the
    file through a C preprocessor to see if a macro is expanding
    unexpectedly somewhere.

    Is worldp properly declared?
     
    Ben Pfaff, Oct 3, 2003
    #3
  4. ArmedCoder

    Ian Tuomi Guest

    ArmedCoder wrote:

    > I keep getting errors saying "parse error before get_world_landind()"
    > and "warning: data definition has no type or storage class"


    I get similar errors when forgetting to close brackets.
    You should try going through the code before the error and see if you
    forgot any.

    --
    Ian Tuomi
    Jyväskylä, Finland

    "Very funny scotty, now beam down my clothes."

    GCS d- s+: a--- C++>$ L+>+++$ E- W+ N+ !o>+ w---
    !O- !M- t+ !5 !X R+ tv- b++ DI+ !D G e->+++ h!

    NOTE: Remove NOSPAM from address
     
    Ian Tuomi, Oct 3, 2003
    #4
  5. Groovy hepcat ArmedCoder was jivin' on 2 Oct 2003 22:08:15 -0700 in
    comp.lang.c.
    Parsing error!?'s a cool scene! Dig it!

    >I have a header file that has the function definition:
    >landindp get_world_landind( worldp world );
    >where landindp and worldp are pointers to structs.
    >I keep getting errors saying "parse error before get_world_landind()"
    >and "warning: data definition has no type or storage class"
    >
    >Now i have the landind.h file included, and landindp is defined as:
    >typedef struct landind *landindp;
    >
    >and in landind.c
    >struct landind
    >{
    >//insert code here
    >} landind_;
    >
    >Any ideas why i would be getting this error? It seems to me that the
    >struct is not being seen, but why?


    Others have given some suggestions, but this may help if they don't.
    I've seen weird things like this if the last line of an included
    header is not properly newline-terminated. Make sure each header ends
    in a newline.

    --

    Dig the even newer still, yet more improved, sig!

    http://alphalink.com.au/~phaywood/
    "Ain't I'm a dog?" - Ronny Self, Ain't I'm a Dog, written by G. Sherry & W. Walker.
    I know it's not "technically correct" English; but since when was rock & roll "technically correct"?
     
    Peter Shaggy Haywood, Oct 8, 2003
    #5
    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. GIMME
    Replies:
    2
    Views:
    877
    GIMME
    Feb 11, 2004
  2. Naren
    Replies:
    0
    Views:
    586
    Naren
    May 11, 2004
  3. Christopher Diggins
    Replies:
    0
    Views:
    613
    Christopher Diggins
    Jul 9, 2007
  4. Christopher Diggins
    Replies:
    0
    Views:
    440
    Christopher Diggins
    Jul 9, 2007
  5. John Levine
    Replies:
    0
    Views:
    737
    John Levine
    Feb 2, 2012
Loading...

Share This Page