[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MS-Windows warnings (was build failure) for Emacs master

From: Angelo Graziosi
Subject: Re: MS-Windows warnings (was build failure) for Emacs master
Date: Wed, 13 Apr 2016 01:36:38 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2

I continue to be of the opinion that those warning should be off by default. Only who take care of Windows port etc. should enable the option to have them, if one needs them, obviously..

In any case, I have already taken the appropriate countermeasures to shutdown them..


Il 13/04/2016 00:52, Paul Eggert ha scritto:
On 04/12/2016 01:54 PM, Angelo Graziosi wrote:

current build logs have a lot of "garbage" like this:

warning: format '%d' expects argument of type 'int', but argument 2
has type 'DWORD {aka long unsigned int}' [-Wformat=]

       printf ("Checking parent status failed: %d\n", GetLastError ());

For portable code, that would be a valid warning. If GetLastError
returns unsigned long, the format should use %lu, not %d

As I understand it, though, MS-Windows defines GetLastError to return
unsigned int on 64-bit machines, and unsigned long on 32-bit machines
(!). This idiosyncrasy could be handled in the MS-Windows port by
something like this:

|#ifdef __MINGW64__ # define pDWORD "" #else # define pDWORD "l" #endif
and then the above code could be: printf ("Checking parent status
failed: %"pDWORD"u\n", GetLastError ()); |

Perhaps %u happens to work on both 32- and 64-bit MS-Windows, and if so
then plain %u should suffice in practice.

checking whether C compiler handles -Wbuiltin-macro-redefined... yes

Why enabling this by default? All this should be OFF by default and
only the maintainers which need it should enable it

Warnings are enabled by default in master if you have a .git
subdirectory (and thus are more likely to be a maintainer-type). See the
thread containing this email:


and the followup change here:


It would be easy enough to disable -Wformat warnings when compiling
anything under MS-Windows), if MS-Windows developers would prefer that.
I'd rather leave these warnings enabled on non-MS-Windows platforms,
though, as they're useful for catching portability glitches.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]