For C99, is the following syntax legal when splitting up static inline functions into separate declarations and definitions?
foo.h:
#include "foo_decl.h"
#include "foo_def.h"
foo_decl.h:
#ifndef _FOO_DECL_H
#define _FOO_DECL_H
/* Here we document foo */
inline int foo(int x);
/* Here we document bar */
inline int bar(int x, int y);
#endif // _FOO_DECL_H
foo_def.h:
#ifndef _FOO_DEF_H
#define _FOO_DEF_H
inline static int foo(int x) { return x+3; }
inline static int bar(int x, int y) { return x-y+22; }
#endif // _FOO_DEF_H
The declaration is really useless to the compiler, but it serves a purpose for collecting documentation for functions in one place without getting cluttered by interspersed implementation details.
Or should foo_decl.h
include the static
keyword?