Should C declarations match definition including keywords and qualifiers such as “static”, “inline”, etc
问题 Consider this example of a function declaration and definition (in the same translation unit): inline static int foo(int x); ... int foo(int x) { return x+1; } I know that the types need to match, but what about other keywords and qualifiers? Should inline static be in both cases? Or just the declaration? And which part of the C standard or which coding guideline could I use to justify the answer? 回答1: No, for inline in particular, these should not be the same. But the example is wrong from