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

ex_malloc.c Compile error

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



Joined: 14 May 2007
Posts: 11

View user's profile Send private message

ex_malloc.c Compile error
PostPosted: Wed Dec 29, 2010 4:53 am     Reply with quote

when i try to compile ex_malloc.c from examples i get errors

Code:

Line 72(27,31): Undefined identifier cell
Line 87(44,48): Undefined identifier cell


my compiler version 4.105
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Wed Dec 29, 2010 8:15 am     Reply with quote

Er.
It is defined just a dozen lines before in the example.
'struct Cell'
Compiles 'as is' for me, with your version.

Best Wishes
altra22



Joined: 14 May 2007
Posts: 11

View user's profile Send private message

PostPosted: Wed Dec 29, 2010 10:22 am     Reply with quote

I know because of that i wrote this post
to see if the problem with my compiler or the version it self?
i did compile the example file 'as-is' with these errors.
dyeatman



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

View user's profile Send private message

PostPosted: Wed Dec 29, 2010 12:59 pm     Reply with quote

FWIW, Version 4.114 is doing the same thing he is reporting.

The Cell struct is clearly defined right after the includes.

I copied and pasted the ex_malloc.c into a blank project I called test1 and
compiled to get exactly the error he is describing on this line:

beginCell = malloc(sizeof(Cell)); // Allocates memory using malloc()

The word Cell is highlighted in sizeof(Cell)
_________________
Google and Forum Search are some of your best tools!!!!
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Dec 29, 2010 1:42 pm     Reply with quote

Curiously, CCS C requires sizeof(struct Cell) instead of sizeof(Cell) since some V4.09x.
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Wed Dec 29, 2010 2:40 pm     Reply with quote

What is odder, is that the version compiles OK for me.
Didn't create a project, just compiled the code 'as is'. Have also tried 4.114, and it too works OK.
It is almost as if the creation of the project alters something, or as if my system has a different setting somewhere.....

Best Wishes
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