commit 0670f46ef86becedfccc80bc0c41d39fa9db37fc parent 02699d5c8f0d773a2f1aac06de95f0072966399f Author: call-cc <callcc@vxempire.xyz> Date: Tue, 2 Jun 2020 20:15:29 -0400 Fix errors in style, plus more stuff about C standardization Diffstat:
M | STYLE.ORG | | | 50 | +++++++++++++++++++++++++++++++++++++++++++++++++- |
1 file changed, 49 insertions(+), 1 deletion(-)
diff --git a/STYLE.ORG b/STYLE.ORG @@ -1,3 +1,5 @@ +#+TITLE: k9core coding style +#+AUTHOR: the k9core team * k9core coding style :PROPERTIES: :CUSTOM_ID: k9core-coding-style @@ -102,4 +104,50 @@ whatever you want to git name and git email. If you don't want to be anonymous, you should sign your commits using gpg. See -[this]https://docs.gitlab.com/ee/user/project/repository/gpg_signed_commits/() +[[this][https://docs.gitlab.com/ee/user/project/repository/gpg_signed_commits/]] + +** C Standard + :PROPERTIES: + :CUSTOM_ID: c-standard + :END: +Development on k9core is to be done in C99 with possible backwards compatiability with ANSI C. +Using c11 or gnu11 or something like that is to be avoided. + +*** Examples +This is okay to use: +#+BEGIN_SRC c + #include <stdio.h> + /* Valid C99 */ + + int + main + { + puts("This will be executed"); + return 0; + } +#+END_SRC + +This is not: +#+BEGIN_SRC c + #include <stdio.h> + #include <stdlib.h> + #include <stdnoreturn.h> + + /* This is not valid c99 */ + + noreturn void + stop(int i) + { + if(i > 0) exit(i); + else exit(1); + } + + int + main() + { + puts("This will be executed"); + stop(0); + puts("This will not be executed"); + } +#+END_SRC +