Re: [code] PATCH: Silence some compilation warnings; lspawn.c

From: Gabriel Dubatti <gdubatti.att.gmail.com>
Date: Wed, 24 Aug 2016 09:43:50 -0300

Hi,

     I got a lot of warnings when cross compiling textadept.c for win32
(with i686-w64-mingw32-gcc).

     I added this macro to textadept.c:

#define UNUSED(expr) do { (void)(expr); } while (0)

     and called it from every function that has some unused parameters,
like:

static int lfind_next(lua_State *L) {UNUSED(L); return
(f_clicked(fnext_button, NULL), 0);}

    or

static int w_focus(GtkWidget*_, GdkEventFocus*__, void*___) {
   UNUSED(_); UNUSED(__); UNUSED(___);

     Best regards,
     Gabriel

El 24/08/2016 a las 09:34, Markus F.X.J. Oberhumer escribió:
> Hi Mitchell,
>
> many thanks for dealing with this issue - the idea is to avoid all trivial
> warnings so that the important ones (which often indicate real bugs) will
> not get unnoticed.
>
> Attached is one more simple patch for scinterm you may want to apply, this
> time to avoid a clang warning -Wunused-private-field:
>
> scintilla/include/Platform.h:433:7: warning: private field 'bigBit' is not used [-Wunused-private-field]
> long bigBit;
> ^
> scintilla/include/Platform.h:434:7: warning: private field 'littleBit' is not used [-Wunused-private-field]
> long littleBit;
> ^
>
> Thanks,
> Markus
>
>
> On 2016-08-23 23:50, Mitchell wrote:
>> Hi Markus,
>>
>> On Thu, 18 Aug 2016, Markus F.X.J. Oberhumer wrote:
>>
>>> It's always worthwhile to compile on high warning levels like "-Wall -Wextra
>>> -Werror",
>>> but it needs some efforts to clean up existing code - but then these are
>>> usually
>>> just trivial patches.
>>>
>>> [snip]
>> I've applied your changes to lspawn.c and also made some changes to gtdialog.c
>> (the latter had quite a few warnings I wasn't aware of). I'm using the "-W
>> -Wall -Wno-unused" compile flags now. Thanks for the prodding.
>>
>> Cheers,
>> Mitchell
>

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Wed 24 Aug 2016 - 08:43:50 EDT

This archive was generated by hypermail 2.2.0 : Thu 25 Aug 2016 - 06:39:22 EDT