emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs-diffs Digest, Vol 94, Issue 89


From: Eli Zaretskii
Subject: Re: Emacs-diffs Digest, Vol 94, Issue 89
Date: Sat, 25 Sep 2010 09:31:38 +0200

> X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00
>       autolearn=unavailable version=3.3.1
> From: Stefan Monnier <address@hidden>
> Date: Sat, 25 Sep 2010 00:25:10 +0200
> Cc: Lars Magne Ingebrigtsen <address@hidden>, address@hidden
> 
> >> -  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 via email to

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