7 Commits

Author SHA1 Message Date
Stephan Bergmann
1f078fcadd Prepare dual-mode compiler plugin feature
...which can act as either a rewriter or a non-rewriter that emits warnings.

Also added COMPILER_PLUGIN_WARNINGS_ONLY=X to demote warnings from plugin X from
errors to warnings, even under --enable-werror.

Change-Id: I05361936240a890515c6bba2459565417c1746b7
2014-01-27 13:12:33 +01:00
Stephan Bergmann
cd20baf40a implicitboolconversion: warn about mixing bool with integer
...in &=, |=, ^=, as does MSVC, too.

Change-Id: I57ecc9d784dd483e04ae561c62595b1d0380517f
2014-01-26 12:28:09 +01:00
Stephan Bergmann
8128644312 implicitboolconversion: also warn about mixing bool/sal_Bool in &=, |=, ^=
...as MSVC would warn about those anyway.

Change-Id: If22dfd35bc01aff1a1bef68702c616e711db42fb
2014-01-22 15:00:54 +01:00
Stephan Bergmann
cb710f3a1e implicitboolconversion: also warn about mixing bool/sal_Bool in == etc.
...as MSVC would warn about those anyway (at least about cases that do not
compare against literal sal_True/sal_False, but warning even about those helped
clean up lots of redundant

  if (foo == true)

instead of just

  if (foo)

etc. across the code base).

Change-Id: Iad4b335c35c5411070f04f87f974db7942c288d4
2014-01-22 11:39:22 +01:00
Stephan Bergmann
4865115d1b Improve Clang 3.2 hasCLanguageLinkageType workaround
Change-Id: If5c104adc05aa362d15cedf6f8953bda478897bc
2014-01-22 11:03:30 +01:00
Stephan Bergmann
3c2a6ad96b Make implicitboolconversion.cxx compile with Clang 3.2
Change-Id: I011e74fd044d0b76cccc60adea362805917c584a
2014-01-20 14:32:35 +01:00
Stephan Bergmann
e908f69ec0 Clang plugin that flags implicit conversions from bool
...as they are often enough errors, like a typo in brace placement in

  if (foo == (FOO || bar == BAR) && baz)

or a literal true passed as an argument to a function that rather expects an
integer bit mask, etc.  The plugin is smart enough to detect interaction with
logically boolean return/parameter types of C functions that use [unsigned] int
instead, and knows the relevant boolean typedefs (sal_Bool, gboolean, etc.).

Change-Id: I5f0e4344fe86589bec35a71018c7effdedf85e3e
2014-01-17 18:45:16 +01:00