]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DOC: readme: add a small reminder about restrictions to respect in the code
authorWilly Tarreau <w@1wt.eu>
Wed, 1 May 2013 08:07:21 +0000 (10:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 1 May 2013 08:09:30 +0000 (10:09 +0200)
For code portability, we need to respect a few restrictions (mainly no C99 etc).

README

diff --git a/README b/README
index 386da83112700ea14f5462b102366f41f842bc6c..54ba1b7d6221f8916b46d76a130e84d60ca7417e 100644 (file)
--- a/README
+++ b/README
@@ -250,6 +250,23 @@ it happens quite often in fact. Also, don't waste your time with the doc when
 submitting patches for review, only add the doc with the patch you consider
 ready to merge.
 
+Another important point concerns code portability. Haproxy requires gcc as the
+C compiler, and may or may not work with other compilers. However it's known
+to build using gcc 2.95 or any later version. As such, it is important to keep
+in mind that certain facilities offered by recent versions must not be used in
+the code :
+
+  - declarations mixed in the code (requires gcc >= 3.x)
+  - GCC builtins without checking for their availability based on version and
+    architecture ;
+  - assembly code without any alternate portable form for other platforms
+  - use of stdbool.h, "bool", "false", "true" : simply use "int", "0", "1"
+  - in general, anything which requires C99 (such as declaring variables in
+    "for" statements)
+
+Since most of these restrictions are just a matter of coding style, it is
+normally not a problem to comply.
+
 If your work is very confidential and you can't publicly discuss it, you can
 also mail me directly about it, but your mail may be waiting several days in
 the queue before you get a response.