Sunday, July 26, 2009

How to disable "inline" keyword in C??

I am doing unit testing of some C code written in Unix. There is a inline keyword before so many functions in header file.


e.g.





static inline functionname(int arg)


(


// function body


}





I am compiling this code on borland compiler fo unit testing.


above function is called inside function under unittest. How do I remove significance on "inline" in one line from all other functions also.

How to disable "inline" keyword in C??
I am not sure will it work in Borland compiler, but you can try to redefine "inline" keyword with a preprocessor.


#define inline


will remove all "inline" from your code before the compilation.
Reply:First of all, inline is not a reserved word in C. It is however a reserved word in C++.





Is the compiler you are using a C compiler or a C++ compiler?





If it is indeed a C++ compiler, you may find the following tutorial to be of use:http://dn.codegear.com/sv/print/23055





On the other hand, if it is a C compiler, more information on the compiler would be helpful.


No comments:

Post a Comment