emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Clean up a couple of compiler warnings


From: Paul Eggert
Subject: Re: [PATCH] Clean up a couple of compiler warnings
Date: Sat, 20 May 2017 23:07:34 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1

On 05/19/2017 02:31 AM, Philipp Stephani wrote:
Apparently on some systems mbstate_t is a nested struct, and the compiler warns about missing braces. Note that memset to initialize a mbstate_t is explicitly recommended in the libc manual:

Yes, of course memset works (which is all that the glibc manual really says). It's just that it's verbose and the verbosity isn't needed.

I guess the problem here is that clang's -Wmissing-braces option generates false alarms. The Clang folks may fix that someday. In the meantime I installed the first attached patch, to turn off that option for Clang.

you could now add
eassert (handlerlist == *dummy);
or so to the cleanup function.

Thanks, good idea, installed in the 2nd attached patch.

I think none of the four branches there work for macOS. https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man2/pathconf.2.html is silent about case sensitivity, so we're already relying on some undocumented functionality. The getattrlist method is at least documented (https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man2/getattrlist.2.html), it just needs to be implemented correctly. I'd suggest to only use a working version of getattrlist on macOS.

I installed that in the 3rd attached patch, at least I hope it works. But better yet, let's drop the getattrlist stuff entirely, as it doesn't seem to be needed and is just wasting our maintenance time. I installed that in the 4th attached patch.

Attachment: 0001-Port-enable-gcc-warnings-to-clang-3.9.1.patch
Description: Text Data

Attachment: 0002-Add-handlerlist-assertion-to-module-code.patch
Description: Text Data

Attachment: 0003-Narrow-DARWIN_OS_CASE_SENSITIVE_FIXME-to-1-choice.patch
Description: Text Data

Attachment: 0004-Remove-DARWIN_OS_CASE_SENSITIVE_FIXME-code.patch
Description: Text Data


reply via email to

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