X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=docs%2Fcoding-style.html;h=8fbb27688cc975c3823ed19517201e9f299a7a72;hb=0dac952932514c931b00b1fae555ebde79f2b4db;hp=250ab88c3d91bc73dd888876a269367208c17e8b;hpb=d31d3e069e7f0811a17942414e5eb4f28c04bf5e;p=ghc-hetmet.git diff --git a/docs/coding-style.html b/docs/coding-style.html index 250ab88..8fbb276 100644 --- a/docs/coding-style.html +++ b/docs/coding-style.html @@ -1,11 +1,12 @@
-no_return
and
+no_return
and
unused
)
-@@ -223,24 +224,24 @@ code is removed altogether if DEBUG is not defined). Particular guidelines for writing robust code:
In particular:
@@ -293,25 +294,25 @@ instead of #define add(x,y) x+y-
#define doNothing() do { } while (0)-
int* p, q; @@ -416,7 +416,7 @@ int *p, *q;but it is preferrable to split the declarations. -
#ifdef 0
+- When commenting out large chunks of code, use
#ifdef 0
... #endif
rather than /* ... */
because C doesn't
have nested comments.
- - When declaring a typedef for a struct, give the struct a name
+
- When declaring a typedef for a struct, give the struct a name
as well, so that other headers can forward-reference the struct name
and it becomes possible to have opaque pointers to the struct. Our
convention is to name the struct the same as the typedef, but add a
@@ -488,10 +488,10 @@ leading underscore. For example:
} Foo;
-
- Do not use ! instead of explicit comparison against
+
- Do not use ! instead of explicit comparison against
NULL or '\0'; the latter is much clearer.
-
- We don't care too much about your indentation style but, if
+
- We don't care too much about your indentation style but, if
you're modifying a function, please try to use the same style as the
rest of the function (or file). If you're writing new code, a
tab width of 4 is preferred.
@@ -501,7 +501,7 @@ tab width of 4 is preferred.
CVS issues
--
+
-
Don't be tempted to reindent or reorganise large chunks of code - it
generates large diffs in which it's hard to see whether anything else
was changed.
@@ -512,5 +512,31 @@ it in case anyone else is changing that file.
+Commandline arguments
+
+A program in fptools should try follow the following rules for
+commandline arguments:
+
+
+- The
-v
and --verbose
options should be
+used to generate verbose output (intended for the user).
+
+ - The
-d
and --debug
options should be
+used to generate debugging output (intended for the developer).
+
+ - The
-?
and --help
options should be used
+to display usage information on stdout. The program should exit
+successfully afterwards.
+
+ - The
-V
and --version
options should be
+used to output version information on stdout, which includes one line
+of the form 'Program version
+Major.Minor[.Patchlevel] ...
'. The program
+should exit successfully afterwards.
+
+
+When an unknown commandline argument is encountered, the program
+should display usage information on stderr and exit unsuccessfully.
+