From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1804 invoked by alias); 19 Apr 2008 00:41:33 -0000 Received: (qmail 1795 invoked by uid 22791); 19 Apr 2008 00:41:33 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 19 Apr 2008 00:41:15 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m3ILWGMK030951; Fri, 18 Apr 2008 17:32:16 -0400 Received: from pobox-3.corp.redhat.com (pobox-3.corp.redhat.com [10.11.255.67]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m3ILWGSh029466; Fri, 18 Apr 2008 17:32:16 -0400 Received: from [127.0.0.1] (vpn-14-21.rdu.redhat.com [10.11.14.21]) by pobox-3.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m3ILW3ZP012658; Fri, 18 Apr 2008 17:32:12 -0400 Message-ID: <4809134F.8070703@redhat.com> Date: Sat, 19 Apr 2008 17:24:00 -0000 From: Dave Brolley User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Mehak Mahajan CC: cgen@sources.redhat.com Subject: Re: Is there a function in cgen for parsing short integers? References: <480907B5.8020201@gmail.com> In-Reply-To: <480907B5.8020201@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cgen-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sourceware.org X-SW-Source: 2008-q2/txt/msg00004.txt.bz2 Message-ID: <20080419172400.ZtL4ItoH2t5sYDUeM9lIxvkv9W3UiajP1peCBt3t6Fw@z> Why would you want to issue a diagnostic for -1? It's not out of range for a 16 bit literal. I would think you would be more interested in cases like 65536 or -65535. As for the user specifying 0xffffffff, I'm wondering if cgen_parse_signed_integer will indicate an error since (in C at least) that's out range of a signed 32 bit integer. Mehak Mahajan wrote: > Hi, > > Thanks for your reply. :) > I am doing precisely what you have decribed. > However, I need to differentiate between -1 which is represented as a > 16 bit number (0xFFFF) and -1 which is represented as a 32 bit number > (0xFFFFFFFF). > Is there a way to do that? > > Cheers, > Mehak