[PUSHED] Some fixes for Clang warnings

Stephan Bergmann sbergman at redhat.com
Mon Apr 23 05:39:25 PDT 2012


On 04/23/2012 01:24 PM, Stephan Bergmann wrote:
>> diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx
>> index 47ca98f..23d4871 100644
>> --- a/cppu/source/uno/lbenv.cxx
>> +++ b/cppu/source/uno/lbenv.cxx
>> @@ -987,7 +987,7 @@ inline void EnvironmentsData::registerEnvironment(
>> uno_Environment ** ppEnv )
>> if (iFind == aName2EnvMap.end())
>> {
>> (*pEnv->acquireWeak)( pEnv );
>> - ::std::pair< OUString2EnvironmentMap::iterator, bool > insertion(
>> + ::std::pair< OUString2EnvironmentMap::iterator, bool > insertion
>> SAL_UNUSED_PARAMETER (
>
> This one made me smile, as it cleverly reuses SAL_UNUSED_PARAMETER for
> something it was not originally designed for. However, I would prefer
> to stick to the standard idiom
>
> (void) insertion; // avoid warnings
>
> here (so that also compilers for which SAL_UNUSED_PARAMETER expands to
> nothing can potentially benefit from the silenced warning), or, even
> better, replace the following OSL_ENSURE with SAL_WARN or SAL_INFO
> (which never expands to code that hides its arguments from the compiler).
>
> SAL_UNUSED_PARAMETER was solely meant to annotate anonymous function
> parameters that cannot be dropped (because the given function needs to
> adhere to a certain function type).

Pushed most of these now:

0001-WaE-Clang-empty-forloop-body.patch: trivially fixed tabs to spaces

0004-WaE-Clang-adding-int-to-a-string-does-not-append-to-.patch: added a 
follow-up to go all the way to "static char const unoinfoSuffix[]"

0005-WaE-Clang-C-linkage-warning.patch: already fixed as 
18f117ae6bde53f4427c777d7bbfca2cf6afdb04

0006-WaE-patch-CLucene-to-avoid-Clang-unused-parameter-wa.patch: it 
could be useful to have some link in clucene/CustomTarget_source.mk 
indicating that the patch has been sent upstream, too

0007-WaE-Clang-expression-result-unused.patch, 
0008-WaE-Clang-implicit-conversion-changes-signedness.patch, and 
0009-WaE-Clang-implicit-conversion-changes-signedness.patch: no comments

Only 0002-WaE-Clang-unused-variable.patch and 
0003-WaE-Clang-unused-variable.patch I did not push.  Can you change 
them as I suggested above (or just let me know if you want me to do that)?

Thanks a lot,
Stephan


More information about the LibreOffice mailing list