Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Parsing error!?

Reply
Thread Tools

Parsing error!?

 
 
ArmedCoder
Guest
Posts: n/a
 
      10-03-2003
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?
 
Reply With Quote
 
 
 
 
Mike Wahler
Guest
Posts: n/a
 
      10-03-2003

"ArmedCoder" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ...
> 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


 
Reply With Quote
 
 
 
 
Ben Pfaff
Guest
Posts: n/a
 
      10-03-2003
http://www.velocityreviews.com/forums/(E-Mail Removed) (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?
 
Reply With Quote
 
Ian Tuomi
Guest
Posts: n/a
 
      10-03-2003
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

 
Reply With Quote
 
Peter Shaggy Haywood
Guest
Posts: n/a
 
      10-08-2003
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"?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What libraries should I use for MIME parsing, XML parsing, and MySQL ? John Levine Ruby 0 02-02-2012 11:15 PM
[ANN] Parsing Tutorial and YARD 1.0: A C++ Parsing Framework Christopher Diggins C++ 0 07-09-2007 09:01 PM
[ANN] Parsing Tutorial and YARD 1.0: A C++ Parsing Framework Christopher Diggins C++ 0 07-09-2007 08:58 PM
SAX Parsing - Weird results when parsing content between tags. Naren XML 0 05-11-2004 07:25 PM
Perl expression for parsing CSV (ignoring parsing commas when in double quotes) GIMME Perl 2 02-11-2004 05:40 PM



Advertisments