User Tools

Site Tools


c_language:c_style

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
c_language:c_style [2021/02/17 15:05] – ↷ Page moved from c_style to c_language:c_style utedassc_language:c_style [2022/09/12 00:30] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Misc ======
 +
 +[[https://www.kernel.org/doc/html/v4.10/process/coding-style.html|The Linux kernel coding style]]
 +
 +[[https://google.github.io/styleguide/cppguide.html|Google C++ coding style]]
 +
 +[[http://web.archive.org/web/20190125125043/http://homepages.inf.ed.ac.uk/dts/pm/Papers/nasa-c-style.pdf|NASA C style guide]]
 +
 +[[https://pubs.opengroup.org/onlinepubs/9699919799/|POSIX style guide?]] 
 +
 +[[https://web.archive.org/web/20190407233045/http://www.maultech.com/chrislott/resources/cstyle/|C and C++ Style Guides]] -- Archived version of a collection of style guides
 +
 +[[https://libevent.org/|libevent]] -- Available API to maybe seek inspiration from. Uses callbacks and stuff.
 +
 +[[https://barrgroup.com/sites/default/files/barr_c_coding_standard_2018.pdf|Embedded C Coding Standard]] -- By Michael Barr
 +
 +[[https://www2.cs.arizona.edu/~mccann/cstyle.html|Indian Hill C Style Manual]]
 +====== Things to consider ======
 +
 ==== Naming ==== ==== Naming ====
 <code c> <code c>
Line 59: Line 78:
 strlen( str ) strlen( str )
 </code> </code>
 +
 +==== Whitespaces in declarations ====
 +
 +<code c>
 +uint32_t *my_func();
 +uint32_t* my_func();
 +uint32_t * my_func();
 +
 +uint32_t *my_var;
 +uint32_t* my_var;
 +uint32_t * my_var;
 +uint32_t *my_var, *another_var, third_var;
 +
 +void a_function_with_a_really_long_name_and_argument_list(int that, int makes, int you, int wonder, int where
 +                                                          int and_how, int to, int break_the, int lines);
 +</code>
 +
 +==== Program flow ====
 +
 +  * Should functions only have one return statement? How/when/why?
 +
 +
c_language/c_style.1613574325.txt.gz · Last modified: 2022/09/12 00:30 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki