On Tue, Aug 19, 2014 at 10:49:53AM +0100, Thomas Adam wrote:
> I've added a note to the TODO about fixing up compiler warning with -Wextra
> as well, since there's a tonne of warnings regarding signed vs. unsigned and
> unused variables, etc. At some point we ought to look at that.
I already tried that at some time, but they are almost all just
false positives:
* Unused parameters are very common in fvwm by design (command
parameters, arguments of library calls) and there's no sensible,
compiler-independent way to get rid of the warnings.
* Comparisons between signed and unsigned are hardly ever a
problem, especially not in fvwm which does hardly ever use the
full range of an int or even a short. These things have been
cleaned up during the 64-bit coding anyway.
* Missing initializers are somewhat interesting, but in my eyes
nothing that warrents a warning. It's well defined in C how
fields that are not mentioned in the initializer are filled,
and I see no reason to forbid that. We're not talking about
c++.
The modules could use some cleanup, though. I'll make a branch
dv/warning-fixes and push what I fix there.
What I'd really like to see is a git commit hook that rejects
commits that introduce certain whitespace errors in C code source
files:
- trailing whitespace
regexp: [[:space::]]$
- tabs after spaces in commits
regexp: [SPACE][TAB]
- tabs anywhere on a line except directly at the start (this
subsumes the previous rule too)
regexp: [^TAB][TAB]
- More than seven consecutive spaces at the beginning of a line
(possibly following any number of tabs).
regexp: ^[TAB]*[SPACE][SPACE][SPACE][SPACE][SPACE][SPACE][SPACE][SPACE]
- Two consecutive unquoted spaces anywhere on a line except at
the beginning of the line (possibly after some tabs). This is
difficult to detect because it needs to take care of " and \"
and \\. Well if the rule is relieved so that is only applies
before the first double quote on a line it's still usefull:
regexp: ^[TAB]*[SPACE]*[^SPACE"TAB][^"]*[SPACE][SPACE]
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt