Hello ARM Community,
I am using DS-5 5.18.1. I have a C function which must be compiled inline to decrease latency of an FIQ handler. I referenced following document for syntax:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0472k/chr1359124973480.html
Note that the attribute may accompany the function declaration and/or definition.
I added the attribute to the function declaration as below in example.c:
void foo(void) __attribute__((always_inline));
The following linking error was produced:
L6218E: Undefined symbol foo (referred from example.o). C/C++ Problem
It is important to note that this error was not present before adding the inline attribute. There are no related warnings, nor any other errors. Why would this single change cause the preceding error?
Thank you,
Ryan
Stefano,
Thank you for your thorough and prompt replies. You present another valid but frowned-upon method of keeping the declaration and definition of the function together by including the .c file. I agree that placing the function definition in the header is at least slightly better practice than this. Instead of inlining the function I have instead decided to check a condition outside the function call in the FIQ handler which will never evaluate true unless a fault occurred. In this way, the speed of the function call is less important.