Automated Arduino coding style & error checking?

I have been wondering for a while why there are no tools to check Arduino code for common mistakes and errors.

Some ideas:

Coding style:
Arduino traps & tips:

http://forum.arduino.cc//index.php?topic=190272.0

Maybe it could be interesting to start from cpplint (Google c++ coding style checker) and make a style checking tool for Arduino?

Or maybe it could be interesting to see what Arduino can learn/use from MISRA-C?

Does anyone know about AVR Libc tools that offer similar features?
http://www.nongnu.org/avr-libc/

It is called the compiler.

Lint might be good, if it works with C++.

We could switch to clang, which has better error messages.