From f44e480242057ecc7a84588a65dfef62264a5534 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 26 Sep 2019 14:12:03 +0200 Subject: DOCS/contribute.md: talk about non-standard and C11 language features The C11 situation is complicated. For example, MinGW doesn't seem to have a full C11 implementation, but we pretty much rely on C11 atomics. Regarding "#pragma once": they say it's not standard because of unsolved (admittedly valid) issues. Btu still, fuck writing include guards, I just can't be bothered with this crap. (Does anyone even read this document?) --- DOCS/contribute.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'DOCS/contribute.md') diff --git a/DOCS/contribute.md b/DOCS/contribute.md index 7afce3be56..fd2ba8032f 100644 --- a/DOCS/contribute.md +++ b/DOCS/contribute.md @@ -153,12 +153,13 @@ General coding - Use C99. Also freely make use of C99 features if it's appropriate, such as stdbool.h. (Except VLA and complex number types.) -- Don't use GNU-only features. In some cases they may be warranted, if they - are optional (such as attributes enabling printf-like format string checks). +- Don't use non-standard language (such as GNU C-only features). In some cases + they may be warranted, if they are optional (such as attributes enabling + printf-like format string checks). "#pragma once" is allowed as an exception. But in general, standard C99 should be used. - The same applies to libc functions. We have to be Windows-compatible too. Use functions guaranteed by C99 or POSIX only, unless your use is guarded by a - configure check. + configure check. There is some restricted use of C11 (ask on IRC for details). - Prefer fusing declaration and initialization, rather than putting declarations on the top of a block. Obvious data flow is more important than avoiding mixing declarations and statements, which is just a C90 artifact. -- cgit v1.2.3