unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: larsi@gnus.org, emacs-devel@gnu.org
Subject: Re: Emacs-diffs Digest, Vol 94, Issue 89
Date: Sat, 25 Sep 2010 09:31:38 +0200	[thread overview]
Message-ID: <83iq1us2hx.fsf@gnu.org> (raw)
In-Reply-To: <jwvlj6q6aql.fsf-monnier+emacs@gnu.org>

> X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00
> 	autolearn=unavailable version=3.3.1
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Sat, 25 Sep 2010 00:25:10 +0200
> Cc: Lars Magne Ingebrigtsen <larsi@gnus.org>, emacs-devel@gnu.org
> 
> >> -  int frame_lines = FRAME_LINES (frame);
> >> +  EMACS_INT frame_lines = FRAME_LINES (frame);
> 
> > Is this really a good idea?  There's no chance the number of lines in
> > a frame will overflow a 32-bit int any time soon.  SO I think an
> > explicit cast to int is a better solution here.
> 
> BTW, if you add casts, as much as possible add them only inside macros,

So what is the practical guidance to Lars and others who go by the
warnings emitted by -Wconversion?  Will the below be okay, for when an
small-valued EMACS_INT is assigned to an int:

 . if the source is EMACS_INT, consider making it an int; if that's
   not possible, cast to int, preferably inside a macro

 . if the source is a Lisp_Object passed through XINT, cast to an int,
   preferably inside an accessor macro



  reply	other threads:[~2010-09-25  7:31 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1OzCq2-00008v-RR@eggs.gnu.org>
2010-09-24 19:00 ` Emacs-diffs Digest, Vol 94, Issue 89 Eli Zaretskii
2010-09-24 19:41   ` Lars Magne Ingebrigtsen
2010-09-24 19:50     ` Eli Zaretskii
2010-09-24 20:19       ` Eli Zaretskii
2010-09-24 20:29         ` David Kastrup
2010-09-25  7:25           ` Eli Zaretskii
2010-09-25  7:50             ` David Kastrup
2010-09-24 22:08         ` Chong Yidong
2010-09-25 20:05           ` Stefan Monnier
2010-09-24 22:25   ` Stefan Monnier
2010-09-25  7:31     ` Eli Zaretskii [this message]
2010-09-25 13:19       ` Lars Magne Ingebrigtsen
2010-09-25 13:28         ` Eli Zaretskii
2010-09-25 20:09       ` Stefan Monnier
2010-09-25 20:30         ` Lars Magne Ingebrigtsen
2010-09-25 22:09           ` Eli Zaretskii
2010-09-26 21:52             ` Stefan Monnier
2010-09-27 15:33               ` Chong Yidong
2010-09-27 16:23                 ` Lars Magne Ingebrigtsen
2010-09-27 20:59                   ` Stefan Monnier
2010-09-27 21:10                     ` Lars Magne Ingebrigtsen
2010-09-27 21:21                       ` Andreas Schwab
2010-09-28  5:47                         ` Eli Zaretskii
2010-09-28  9:26                           ` Lars Magne Ingebrigtsen
2010-09-28 22:35                             ` Stefan Monnier
2010-09-29 13:15                           ` Davis Herring

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83iq1us2hx.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).