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

#inline

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



Joined: 17 Sep 2004
Posts: 133
Location: UK

View user's profile Send private message

#inline
PostPosted: Thu Jan 13, 2005 4:21 am     Reply with quote

I am using PIC16F877A, compiler version 3.190

When I use the "#inline" as follows:

#inline
void TxPacket(BYTE *Descriptor)
{
}

I get the error: Function definition different from previous definition


The function delared as: void TxPacket(BYTE *Descriptor);

Any ideas?
_________________
Alex
Ttelmah
Guest







Re: #inline
PostPosted: Thu Jan 13, 2005 4:24 am     Reply with quote

alexz wrote:
I am using PIC16F877A, compiler version 3.190

When I use the "#inline" as follows:

#inline
void TxPacket(BYTE *Descriptor)
{
}

I get the error: Function definition different from previous definition


The function delared as: void TxPacket(BYTE *Descriptor);

Any ideas?

You need to add #inline to the definition as well.

Best Wishes
alexz



Joined: 17 Sep 2004
Posts: 133
Location: UK

View user's profile Send private message

Re: #inline
PostPosted: Thu Jan 13, 2005 4:26 am     Reply with quote

Ttelmah wrote:
alexz wrote:
I am using PIC16F877A, compiler version 3.190

When I use the "#inline" as follows:

#inline
void TxPacket(BYTE *Descriptor)
{
}

I get the error: Function definition different from previous definition


The function delared as: void TxPacket(BYTE *Descriptor);

Any ideas?

You need to add #inline to the definition as well.

Best Wishes



Which definition?
Where I declare the function you mean?
_________________
Alex
alexz



Joined: 17 Sep 2004
Posts: 133
Location: UK

View user's profile Send private message

PostPosted: Thu Jan 13, 2005 4:28 am     Reply with quote

If I add the #inline to the function declaration as well:

#inline
void TxPacket(BYTE *Descriptor);

I get the following error:
Out of ROM, A segment or the program is too large
_________________
Alex
alexz



Joined: 17 Sep 2004
Posts: 133
Location: UK

View user's profile Send private message

PostPosted: Thu Jan 13, 2005 4:48 am     Reply with quote

Right, I have solved it, I just had too large function.
I have splited it to a few smaller, and no problems then.

The next question is, can I use #inline only for functions, or I can use it for a separete row only as well?

What else does it effect except the speed?
_________________
Alex
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Jan 13, 2005 6:50 am     Reply with quote

Quote:
The next question is, can I use #inline only for functions, or I can use it for a separete row only as well?


It is for functions. Not sure what you mean by "row" unless you mean line of code which is of course "inline".

Tells the compiler that the function immediately following the directive is to be implemented INLINE. This will cause a duplicate copy of the code to be placed everywhere the function is called. This is useful to save stack space and to increase speed. Without this directive the compiler will decide when it is best to make procedures INLINE.
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