From 8dea136109b0aafd545b15916407a832831a43d4 Mon Sep 17 00:00:00 2001 From: Roland Illig Date: Tue, 8 Feb 2005 09:05:14 +0000 Subject: [PATCH] * How to include header files properly. --- maint/headers.txt | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 maint/headers.txt diff --git a/maint/headers.txt b/maint/headers.txt new file mode 100644 index 000000000..73b9a80ec --- /dev/null +++ b/maint/headers.txt @@ -0,0 +1,42 @@ +This file documents some conventions for sorting system header files in +the #include section. + +1. #include unconditionally + +2. if there are any headers containing "alloca" in the name, include + them here. Some systems need them as the first header. + +3. #include the Standard C Library headers, sorted alphabetically + + (assert, ctype, errno, float, limits, locale, math, setjmp, signal, + stdarg, stddef, stdio, stdlib, string, time) + +4. #include the POSIX headers, in the following order + + Needed by many other headers. + + <*.h> + + For every POSIX function you use, make sure that the order of the + headers is the same as in the according manpage. + +5. #include other external headers + +6. #include "../src/global.h" + +7. #include Midnight Commander headers + + Currently, not all headers can be ordered arbitrarily, so try it out. + + +==== Headers that may be included unconditionally ==== + + + + + + +==== Headers that need autoconf guards ==== + + +