Let's say I have a following situation
/* module a.c */
Data secret; /* data to remain hidden */
inline int veryShortProcedure( int d ) { /* using secret */ }
/* a.h */
int veryShortProcedure( int );
/* module b.c */
#include "a.h"
int procedure( int d ) {
/* something */
veryShortProcedure( d );
}
The code is not correct from any C standard point of view, since whenever a procedure is inline, I cannot split it into prototype and declaration, thus I should define it in a.h.
Nevertheless the code compiles in gcc with -std=gnu90 option. My question is, what does it do then? Does gcc ignore my inline declaration? Putting the code in that way would be to my mind like wanting to inline a function on linker level, which is absurd.
What is the common practice in such case? Should I sacrifice safety or efficiency (jumping to short procedures is kinda inefficient)?