CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

How to solve "Expecting an identifier"

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
flowlo



Joined: 19 Jan 2011
Posts: 1
Location: Austria

View user's profile Send private message

How to solve "Expecting an identifier"
PostPosted: Wed Jan 19, 2011 4:08 pm     Reply with quote

I tried to compile following code:
Code:
/* A couple of defines */
int dcf(unsigned int* mode, short int* bits, unsigned int* time, unsigned int* clock, unsigned int* tick) {
/* Other code ... */


The CCS Compiler throws following error:

Quote:
Error[28] Z:\home\flowlo\...\src\dcf.c 19 : Expecting an identifier
1 Errors, 0 Warnings.


Would you be so kind and help me out?
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Wed Jan 19, 2011 4:11 pm     Reply with quote

Sometimes the compiler will point to a line and say there's an error when in fact the error is just above the line being pointed to. Look in your code that is previous to this line and see if there's something amiss.

Ronald
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Wed Jan 19, 2011 4:11 pm     Reply with quote

Must be a problem with code before this line.

Your line compiles with no problem under 4.114.
_________________
Google and Forum Search are some of your best tools!!!!
Ttelmah



Joined: 11 Mar 2010
Posts: 19551

View user's profile Send private message

PostPosted: Thu Jan 20, 2011 2:48 am     Reply with quote

There are a couple of other things:

You cannot have a pointer to a _short_. This is in the manual. Though it may compile, it will not work...

You can also get this error, if a keyword is being 're-used'. For instance, if there is a #define, making 'time' be replaced with the number '4', then the line parses out as:
Code:

int dcf(unsigned int* mode, short int* bits, unsigned int* 4, unsigned int* clock, unsigned int* tick) {

and you would get the described error message.

Best Wishes
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Thu Jan 20, 2011 7:31 am     Reply with quote

Do you realize what a type short is in CCS? A short is only one bit, a Boolean. I don't think that is what you are looking for. A regular int is 8 bits.
_________________
The search for better is endless. Instead simply find very good and get the job done.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group