On 02/21/13 01:53, Joerg Schilling wrote: > - gcc warns for so called "uninitilized varaiables" and other compilers > rightfully for the same code complain about useless code after you > added the "initialization" gcc asked for.
We avoid this problem Coreutils, Tar, etc. by putting these useless initializations in "#ifdef lint" code. In practice, it's rarely needed (GNU Tar does this in only one place). Normally, "lint" isn't defined, but if you compile with --enable-gcc-warnings it is enabled. > - gcc does not understand the "%r" printf() format That's fine and is what we want, as we want to write portable code and can't rely on %r. > - gcc-4.x (as configured on some linux systems) warns about ignored > function return values Yes, that's truly annoying. We fix that in Coreutils by using Gnulib's ignore-value module. It doesn't come up often, though, thank goodness. GNU Tar doesn't need ignore-value at all. > - gcc-4.x started to include other more lint like checking but ignores > lint special comments such as "/*LINTED*/", "/*ARGSUSED*/", ... > (see "man lint"). This makes it impossible to make it quiet in border > cases. In Coreutils and Tar we don't use the old lint directives; we use the corresponding GCC directives instead. They aren't needed very often, and work well when they are needed.