3 ms·
> So, the C style they use is: function types on their own line and spaces between function names and their parameters? Having function return types on an extr
by camel-cdr 4y ago
> So, the C style they use is: function types on their own line and spaces between function names and their parameters?
Having function return types on an extra line is actually quite useful, because you can easily grep for the function implementation with `grep ^foo -r .`
This works quite well, even on huge code bases.
- drewg123 4y agoNot sure why you're being downvoted.. I came here to say exactly that. FreeBSD maintains this style, so you can just 'git grep ^function' to find a function's definition. When working with other codebases which don't follow this convention, its somewhat frustrating to find a function's definition with just grep.
- numeromancer 4y agoIt also scales with increased qualifiers: static inline const unsigned int * function()
- raverbashing 4y agoYes, I know. (I'm more bothered by the space in calls rather than this, though this is not my favourite way) Or: You can use ctags (like the Linux kernel) or just grep for something like (egrep) '^[a-z]+ .+foo\(' if you're really bothered by grepping function calls instead of only definitions