On 29 Aug, Don Lewis wrote:
> When building OpenOffice trunk revsion r1758161 as a FreeBSD port on
> FreeBSD 12.0-CURRENT with clang 3.8.0, I get the following warnings.
> I'm mostly interested in the OpenOffice code and not the bundled
> external code, so I specifically built the FreeBSD port it uses
> --with-system-foo extensively which minimizes the compilation of third
> party code.  The total number of warnings is 5105.
> 
> 1175 -Wtautological-undefined-compare
>  949 -Wunused-private-field
>  660 -Wshift-negative-value
>  391 -Wunused-parameter
>  362 -Wunused-const-variable
>  312 -Woverloaded-virtual
>  177 -Wunused-variable
>  116 -Winfinite-recursion
>  109 -Wlogical-op-parentheses
>   93 -Wsign-compare
>   76 -Wdelete-non-virtual-dtor
>   72 -Wint-to-void-pointer-cast
>   63 -Wshadow
>   55 -Wunused-function
>   41 -Wformat
>   36 -Wreturn-type-c-linkage
>   30 -Wchar-subscripts
>   27 -Wdeprecated-declarations
>   26 -Wundefined-bool-conversion
>   26 -Wsizeof-pointer-memaccess
>   26 -Wformat-security
>   24 -Wunused-local-typedef
>   22 -Wmacro-redefined
>   21 -Wswitch
>   20 -Wbitwise-op-parentheses
>   18 -Winvalid-source-encoding
>   13 -Wuninitialized
>   11 -Wtautological-compare
>   11 -Wlogical-not-parentheses
>   11 -Wdangling-else
>    9 -Wmismatched-new-delete
>    8 -Wimplicit-function-declaration
>    8 -Wheader-guard
>    8 -Wcomment
>    7 -Wtautological-constant-out-of-range-compare
>    7 -Wself-assign
>    6 -Wunused-value
>    6 -Wunneeded-internal-declaration
>    6 -Wtautological-pointer-compare
>    6 -Wpointer-bool-conversion
>    6 -Wparentheses-equality
>    6 -Wdynamic-class-memaccess
>    6 -Wconstant-conversion
>    5 -Wpointer-sign
>    4 -Wnull-conversion
>    3 -Wunsequenced
>    3 -Wreorder
>    3 -Wknr-promoted-parameter
>    3 -Wint-to-pointer-cast
>    2 -Wstrncat-size
>    2 -Wstring-compare
>    2 -Wsometimes-uninitialized
>    2 -Wconstant-logical-operand
>    2 -Warray-bounds
>    1 -Wunused-comparison
>    1 -Wunknown-pragmas
>    1 -Wstring-plus-int
>    1 -Wpotentially-evaluated-expression
>    1 -Wnon-literal-null-conversion
>    1 -Wmismatched-tags
>    1 -Wincompatible-pointer-types-discards-qualifiers
>    1 -Wimplicit-int
>    1 -Wignored-qualifiers
>    1 -Wformat-extra-args
>    1 -Wcompare-distinct-pointer-types
>    1 -Wc++11-compat-deprecated-writable-strings

Now down to 2708 warnings.  It'll be slower going from this point
forward because each of the remaining issues will have a much smaller
impact on the warning count that many of the ones I have already fixed.

FWIW, bundled icc is getting to be a significant contributer to the
remaining warnings.

One of the -Wunused-parameter warnings led me to this questionable bit
of code in filter/source/xsltfilter/containerhelper.hxx:

        template<typename FuncType, typename ParamType>
        inline void forEachMem(FuncType pFunc, ParamType aParam) const
        {
                forEach( ::boost::bind(pFunc, _1, aParam));
        }

        template<typename FuncType, typename ParamType1, typename ParamType2>
        inline void forEachMem(FuncType pFunc, ParamType1 aParam1, ParamType2 
aParam2) const
        {
                forEach( ::boost::bind(pFunc, -1, aParam1, aParam2 ));
        }
 
        template<typename FuncType, typename ParamType1, typename ParamType2, 
typename ParamType3>
        inline void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 
aParam2, ParamType3 aParam3 ) const
        {
                forEach( ::boost::bind(pFunc, _1, aParam2, aParam2, aParam3 ));
        }

In the three parameter version of this code, it looks like aParam1
should be used instead of using aParam2 twice.  Also, in the two
parameter version of the code, it looks like _1 should be used instead
of -1.  I haven't had a chance to investigate the possible symptoms of
these errors or how to text the appropriate fix.

 493 -Wunused-private-field
 391 -Wunused-parameter
 366 -Wunused-const-variable
 314 -Woverloaded-virtual
 181 -Wunused-variable
 109 -Wlogical-op-parentheses
  93 -Wsign-compare
  77 -Wdelete-non-virtual-dtor
  72 -Wint-to-void-pointer-cast
  63 -Wshadow
  56 -Wunused-function
  41 -Wformat
  36 -Wreturn-type-c-linkage
  30 -Wchar-subscripts
  27 -Wdeprecated-declarations
  26 -Wundefined-bool-conversion
  26 -Wsizeof-pointer-memaccess
  25 -Wtautological-undefined-compare
  24 -Wunused-local-typedef
  22 -Wmacro-redefined
  21 -Wswitch
  20 -Wbitwise-op-parentheses
  18 -Winvalid-source-encoding
  13 -Wuninitialized
  11 -Wtautological-compare
  11 -Wlogical-not-parentheses
  11 -Wdangling-else
   9 -Wmismatched-new-delete
   8 -Wimplicit-function-declaration
   8 -Wcomment
   7 -Wtautological-constant-out-of-range-compare
   7 -Wself-assign
   7 -Wheader-guard
   6 -Wunused-value
   6 -Wunneeded-internal-declaration
   6 -Wtautological-pointer-compare
   6 -Wpointer-bool-conversion
   6 -Wparentheses-equality
   6 -Wdynamic-class-memaccess
   6 -Wconstant-conversion
   5 -Wpointer-sign
   4 -Wnull-conversion
   3 -Wunsequenced
   3 -Wreorder
   3 -Wknr-promoted-parameter
   3 -Wint-to-pointer-cast
   2 -Wstrncat-size
   2 -Wstring-compare
   2 -Wsometimes-uninitialized
   2 -Wconstant-logical-operand
   2 -Warray-bounds
   1 -Wunused-comparison
   1 -Wunknown-pragmas
   1 -Wstring-plus-int
   1 -Wpotentially-evaluated-expression
   1 -Wnon-literal-null-conversion
   1 -Wmismatched-tags
   1 -Wincompatible-pointer-types-discards-qualifiers
   1 -Wimplicit-int
   1 -Wignored-qualifiers
   1 -Wformat-extra-args
   1 -Wcompare-distinct-pointer-types
   1 -Wc++11-compat-deprecated-writable-strings


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@openoffice.apache.org
For additional commands, e-mail: dev-h...@openoffice.apache.org

Reply via email to