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

Error calling a function "a numeric expression must ...

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



Joined: 16 Oct 2008
Posts: 18
Location: Chile

View user's profile Send private message

Error calling a function "a numeric expression must ...
PostPosted: Mon Jan 05, 2009 8:44 am     Reply with quote

Hi everyone Smile, I'm new here, this is my first post. Great forum BTW!

Ok, so here is my problem (probably something obvious I'm failing to see)

Code:

int CC1100_ReadReg(int dir){
        dir=1
   return dir;
}
      
void main(){
   int aux;
   aux=CC1100_ReadReg(i);   // <== Here is the error
}


I'm getting error:
Error 51 "Transceptor.c" Line 23(45,46): A numeric expression must appear here

I've stripped the code as much a I could, and the error is still there, what am I doing wrong?
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Mon Jan 05, 2009 9:49 am     Reply with quote

the ; character is missing from dir=1 line

should be:

Code:

int CC1100_ReadReg(int dir){
        dir=1;
   return dir;
}
     
void main(){
   int aux;

_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
daraos



Joined: 16 Oct 2008
Posts: 18
Location: Chile

View user's profile Send private message

PostPosted: Mon Jan 05, 2009 10:16 am     Reply with quote

Thanks Andrew, but that was a mistake I made posting the code. I tried with other functions, and the error appears when I'm giving a variable to a function. For example:
Code:

void MyFunction(void){ ..... }   //Don't give errors
int MyFunction(void){{ ..... } //Don't give errors
void MyFunction(int address) //Error:A numeric value must appear here


I tried calling the function with a number and with a variable, and the outcome is the same.
daraos



Joined: 16 Oct 2008
Posts: 18
Location: Chile

View user's profile Send private message

PostPosted: Mon Jan 05, 2009 10:20 am     Reply with quote

Solved
I failed to close a parenthesis Rolling Eyes

Thanks for your time Smile
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