summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-09-26 14:12:03 +0200
committerwm4 <wm4@nowhere>2019-09-26 14:17:00 +0200
commitf44e480242057ecc7a84588a65dfef62264a5534 (patch)
treed23392141ddcbb3353b59e135e6da5b8c99d64b8
parent31c04f162b8c7bfaed7f76eaa18da3c4f41c090e (diff)
downloadmpv-f44e480242057ecc7a84588a65dfef62264a5534.tar.bz2
mpv-f44e480242057ecc7a84588a65dfef62264a5534.tar.xz
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?)
-rw-r--r--DOCS/contribute.md7
1 files changed, 4 insertions, 3 deletions
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.