From: Wei Liu Subject: Re: [PATCH RFC] libxl: support for using 'MmGg' as memory size suffix Date: Wed, 25 Sep 2013 14:48:23 +0100 Message-ID: <20130925134823.GD14211@zion.uk.xensource.com> References: <1379778703-26986-1-git-send-email-wei.liu2@citrix.com> <1380116164.23688.156.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1380116164.23688.156.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Ian Jackson , Wei Liu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, Sep 25, 2013 at 02:36:04PM +0100, Ian Campbell wrote: > On Sat, 2013-09-21 at 16:51 +0100, Wei Liu wrote: > > diff --git a/tools/libxl/libxlu_cfg_l.l b/tools/libxl/libxlu_cfg_l.l > > index e0ea8cf..0b1f299 100644 > > --- a/tools/libxl/libxlu_cfg_l.l > > +++ b/tools/libxl/libxlu_cfg_l.l > > This will need Ian J's review when he gets back. > > > @@ -60,6 +60,10 @@ void xlu__cfg_yyset_column(int column_no, yyscan_t yyscanner); > > yylval->string= xlu__cfgl_strdup(ctx,yytext); > > GOT(NUMBER); > > } > > +[0-9][0-9a-fx]*[MmGg] { > > You copied this from above but "[0-9][0-9a-fx]*" looks odd to me. I > think it is intended to accept decimals and hex 0xNNN but it actually > ends up accepting 1111xxxxx99999ddddd and nonsensical things like that, > doesn't it? > I had the same impression. However strtol() accepts up to base 36 which makes 1111xxxxx99999dddd sensible... > I suppose we will reject such things later. > > > + yylval->string= xlu__cfgl_strdup(ctx,yytext); > > + GOT(STRING); > > This sort of subtle semantic change GOT(NUMBER)=>(STRING) is what needs > Ian's thoughts... > Right. I haven't figure out what's the best way to handle this. Wei.