all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philipp Stephani <phst@google.com>
To: Paul Eggert <eggert@cs.ucla.edu>,
	Philipp Stephani <p.stephani2@gmail.com>,
	emacs-devel@gnu.org
Subject: Re: [PATCH] Clean up a couple of compiler warnings
Date: Fri, 19 May 2017 09:31:39 +0000	[thread overview]
Message-ID: <CAP-RRPtjkhwHjvMLx4AD=HhMJgWwMOZcUoPe87+zsoe3v7nkng@mail.gmail.com> (raw)
In-Reply-To: <e1c93027-c635-c5f0-38fc-c59324657d7d@cs.ucla.edu>

[-- Attachment #1: Type: text/plain, Size: 3192 bytes --]

Paul Eggert <eggert@cs.ucla.edu> schrieb am Fr., 19. Mai 2017 um 05:48 Uhr:

> > * 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.
>

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:
https://www.gnu.org/software/libc/manual/html_node/Keeping-the-state.html


>
>
> > * 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.
>

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


>
> > * 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.
>

Looks good. I'm no fan of silencing implicit conversion warnings by
introducing explicit casts either.


>
>
>  > * 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.
>

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.
-- 

Google Germany GmbH
Erika-Mann-Straße 33
80636 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle

Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind,
leiten Sie diese bitte nicht weiter, informieren Sie den Absender und
löschen Sie die E-Mail und alle Anhänge. Vielen Dank.

This e-mail is confidential. If you are not the right addressee please do
not forward it, please inform the sender, and please erase this e-mail
including any attachments. Thanks.

[-- Attachment #2: Type: text/html, Size: 4539 bytes --]

  parent reply	other threads:[~2017-05-19  9:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-18 20:24 [PATCH] Clean up a couple of compiler warnings Philipp Stephani
2017-05-18 20:40 ` Eli Zaretskii
2017-05-19  3:48 ` Paul Eggert
2017-05-19  6:53   ` Eli Zaretskii
2017-05-19  6:55     ` Paul Eggert
2017-05-19  9:31   ` Philipp Stephani [this message]
2017-05-21  6:07     ` Paul Eggert
2017-05-21 20:00       ` Philipp Stephani
2017-05-21 20:33         ` Paul Eggert
2017-05-23 10:17           ` Philipp Stephani
2017-05-23 17:36             ` Paul Eggert
2017-05-23 19:19               ` Eli Zaretskii
2017-05-23 19:21               ` Philipp Stephani
2017-05-21 20:47         ` Perry E. Metzger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP-RRPtjkhwHjvMLx4AD=HhMJgWwMOZcUoPe87+zsoe3v7nkng@mail.gmail.com' \
    --to=phst@google.com \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=p.stephani2@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.