Next
Previous
Contents
Try to avoid :
- macros with variable number of arguments (gcc specific)
- iusing ' in macros (gcc doesn't like it) (i.e. no
#error Didn't work !)
- inlining functions (gcc specific) (if you do, try to provide a
fallback .c file)
- avoid doing things like
(void *) struct->ptr = my_pretty_function;
and instead declare arguments like :
struct->ptr = ((int *)(int,int,int)) my_pretty_function;
- doing arithmetic on
(void *) like in
void *bla;*(bla+10)=blubb;.
This is GCC specific and very confusing.
- If you write shell scripts, always use /bin/sh
- As most Linux-systems have /bin/sh symlinked to bash
this won't help that much. I suggest that if you want to
write/modify scripts you install at least one other
Bourne-style shell and test your code with it.
- Never make ANY assumptions about the size of datatypes!
If your code depends on a datatype being of a certain size,
use the
[us]int* datatypes.
- Do NOT use uchar, ushort, uint or ulong! Those are very
non-standard datatypes. Either use one of the GGI datatypes
or unsigned <type>.
- Don't use gcc specific stuff unless you're writing code that
is expected to be compiled with gcc only (ie. Linux kernel code)
Next
Previous
Contents