As you noticed, weird things can happen. :-( For MacOS, don't define anything to indicate BSD or POSIX source. That would break stuff. For Linux, the FSF bastards demand _GNU_SOURCE as part of their plan to give Linux an ugly name.
I suggest: -std=gnu99 (accept modern code) -D_GNU_SOURCE (satisfy Stallman's ego) -O2, -O3, or -Os (required for some warnings!) -Wl,-warn-common (warn about UNIX-only C feature) -fno-common (block that UNIX-only C feature) -ffast-math (allow algebraic simplification) -Wall (most useful warnings) -W (more useful warnings) -Wshadow (shadowing confuses people: bugs) -Wcast-align (not portable) -Wredundant-decls (find missing header protection) -Wbad-function-cast -Wcast-qual -Waggregate-return (code may be slow) -Wstrict-prototypes (very important for quality C) -Wmissing-prototypes (very important for quality C) If not debugging: -s (make executable file smaller) -fomit-frame-pointer (make code smaller and faster) If debugging: -g3 (the "3" gets you line info) If you truly must support ancient compilers: -Wdeclaration-after-statement (ouch) If the compiler accepts the option: -Wstrict-aliasing (catch horrible bugs) _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development