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

Expecting Function Name error.....

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



Joined: 24 Apr 2014
Posts: 138

View user's profile Send private message

Expecting Function Name error.....
PostPosted: Tue May 15, 2018 12:09 pm     Reply with quote

Hi All,

I have a function (#2), that calls another function (#1) from within. When I try to compile the code, I get an error in function #2 where the #1 function is called. This error is: Expecting Function Name. Everything looks totally fine, and I can't see why it won't compile?

On a hunch I renamed function #1 from 'DOW' to '_DOW', and now the code compiles and works as expected. I seem to remember a similar fix from a while back when one of my function names started with a numerical character. Same fix, but apparently a different reason?

This works:
Code:
firstDOW = _DOW(year,month,targetDate);


This doesn't:
Code:
firstDOW = DOW(year,month,targetDate);


PCH v5.050

Any clues?

Jack
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue May 15, 2018 12:31 pm     Reply with quote

off the top of my head... do you have function #1 coded before #2 ? I'm wondering if the compiler needs them that way as #2 has to call #1 and if #2 was written before #1, then the compiler would 'see' it ??
One of those chicken vs eggs deals.
I'm probably wrong as I'm not a C guy or compiler guru, just something I'm thinking while the rain comes down...
Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19546

View user's profile Send private message

PostPosted: Tue May 15, 2018 12:51 pm     Reply with quote

Possibly you have something else called DOW already in the program. A variable etc..
JAM2014



Joined: 24 Apr 2014
Posts: 138

View user's profile Send private message

PostPosted: Tue May 15, 2018 1:06 pm     Reply with quote

Hi All,

Yes, Argh!!, a variable also called 'DOW' was the issue!

Thanks,

Jack
Ttelmah



Joined: 11 Mar 2010
Posts: 19546

View user's profile Send private message

PostPosted: Tue May 15, 2018 1:43 pm     Reply with quote

Very Happy

The error was telling you exactly what was wrong, but it wasn't exactly expressing it in an 'obvious' way....
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