From mboxrd@z Thu Jan 1 00:00:00 1970 From: PUCCETTI Armand Subject: e820.c : why char* ? Date: Fri, 23 Jun 2006 18:09:51 +0200 Message-ID: <449C124F.6050805@cea.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org In function sanitize_e820_map(struct e820entry * biosmap, char * pnr_map) of file e820.c, the last argument is treated as an integer, but when compiling with gcc it belongs to [-128,127]. Inside the body of that function, however, we use that argument as an int to fill up a table of a different size, namely: static struct change_member *change_point [256] static struct change_member change_point_list [256] static int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map) { ... old_nr = *pnr_map; ... for (i=0; i < 2*old_nr; i++) { change_point[i] = &change_point_list[i]; ... } After the loop, change_point is not completely filled-up, as change_point [254] and change_point [255] are never filled nor used. Is it voluntary that pnr_map gets typed and used like this? Armand