<br><br>
<div class="gmail_quote">2009/1/15 Francois Gouget <span dir="ltr">&lt;<a href="mailto:fgouget@free.fr">fgouget@free.fr</a>&gt;</span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="Ih2E3d">On Wed, 14 Jan 2009, Eric Pouech wrote:<br><br>&gt; Francois Gouget a écrit :<br>&gt; &gt; Hi,<br>&gt; &gt;<br>&gt; &gt; I have noticed that expr_alloc_uconstant() is unused in winedbg.<br>&gt; &gt; Is that normal?<br>
&gt; &gt;<br>&gt;<br>&gt; the main point is that the lexer only returns signed integers, while it<br>&gt; should return both signed and unsigned integers<br><br></div>Actually, as far as I can tell, the lexer can only match unsigned<br>
integers:<br><br>DIGIT &nbsp; &nbsp; &nbsp;[0-9]<br>HEXDIGIT &nbsp; [0-9a-fA-F]<br>&quot;0x&quot;{HEXDIGIT}+ &nbsp; &nbsp;{ sscanf(yytext, &quot;%x&quot;, &amp;dbg_lval.integer); return tNUM; }<br>{DIGIT}+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { sscanf(yytext, &quot;%d&quot;, &amp;dbg_lval.integer); return tNUM; }<br>
<br>Both &#39;regexps&#39; only match unsigned integers. And yet they are scanned<br>with %d instead of %u. And then this continues in the grammar:<br><br>&nbsp; &nbsp; &nbsp;tNUM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ $$ = expr_alloc_sconstant($1); }<br>
<br>So maybe we should treat all these as unsigned, use<br>expr_alloc_uconstant(), and then it is expr_alloc_sconstant() that would<br>be unused?<br><br>Or should we really accept negative integers in the lexer?<br>
<div class="Ih2E3d">&nbsp;</div></blockquote>
<div>actually, doing what you suggest would help the lexer, but will put the issue a bit later in the expression computation package, where only signed ints are computed (and moreover that code is likely to be broken on&nbsp;a 64bit CPU)</div>

<div>so, moving to a unsigned requipes also to fix expr.c</div>
<div>A+</div>
<div>&nbsp;</div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="Ih2E3d"><span id=""></span><br clear="all"><br>-- <br>-- <br>Eric Pouech<br></div></blockquote></div>