emacs-devel
[Top][All Lists]
Advanced

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

Re: Buffer size limitation in insdel.c


From: Andreas Schwab
Subject: Re: Buffer size limitation in insdel.c
Date: Thu, 23 Sep 2010 15:12:40 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Lars Magne Ingebrigtsen <address@hidden> writes:

> dispnew.c:783: warning: conversion to 'int' from 'Lisp_Object' may alter its 
> value

This is an obvious bug.  A Lisp_Object value must never be treated as an
integer, and this will fail to compile with --enable-use-lisp-union-type
(which is a good idea to enable during development).

> dispnew.c:2178: warning: conversion to 'long unsigned int' from 'short int' 
> may change the sign of the result
>
>       size_t nbytes = from->used[TEXT_AREA] * sizeof (struct glyph);

This is only a problem if from->used[TEXT_AREA] can be negative, which
it can't.  Might be worth to change to unsigned short.

Andreas.

-- 
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



reply via email to

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