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: Thu, 18 May 2017 20:48:42 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1

Philipp Stephani wrote:

> * sysdep.c (system_process_attributes): Remove unused variables.

Thanks, I installed that in your name (1st attached patch).


* emacs.c (using_utf8): Don't assume anything about mbstate_t type.

The old code doesn't assume anything about the type either, and should work regardless of how mbstate_t is implemented. The proposed change makes the code a bit harder to read, so I'd rather avoid it if possible. I couldn't reproduce the warning that you're evidently seeing. Perhaps you can work around the problem in the same way I worked around the problem with floats and doubles (see below)?


* emacs-module.c (MODULE_SETJMP_1): Mark dummy variable as unused.

Rather than do that, let's just use the variable; that's more robust. I installed the 2nd attached patch.

* lread.c (string_to_number): Use constants of double type.
* editfns.c (decode_float_time):
* fns.c (make_hash_table, maybe_resize_hash_table)
(Fhash_table_rehash_size, Fhash_table_rehash_threshold):
Explicitly cast floating-point values.

There should be no problem (i.e., no loss of info) converting a float to a double, so these changes are not needed. I assume you're using clang. I reproduced its false alarms on Fedora 25 x86-64, which uses clang 3.9.1, and installed the 3rd attached patch to work around the problem.


> * fileio.c (file_name_case_insensitive_p): Add cast.

Rather than waste time static-checking the DARWIN_OS_CASE_SENSITIVE_FIXME == 2 code let's just #ifdef it out. I did that in the 4th attached patch. Maybe we should just remove it, since nobody is using it and (as you note) it doesn't work anyway.

Attachment: 0001-Clean-up-some-compiler-warnings.patch
Description: Text Data

Attachment: 0002-Clean-up-compiler-warning-in-emacs-module.c.patch
Description: Text Data

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

Attachment: 0004-Fix-DARWIN_OS_CASE_SENSITIVE_FIXME-2-false-alarm.patch
Description: Text Data


reply via email to

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