Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 60e67bcf7be02461cfd1de1547249a34a6caa3654dcc6f3c4c491cf3eb871300
Ticket: 3d3124d01dabb46584e39877d44802bf5e8f4952
failures with -ftrapv compiler option
User & Date: chrstphrchvz on 2023-08-15 07:26:51
Changes

  1. icomment:
    I am not certain which operation overflowed here. <tt>c - '0'</tt> only overflows when <tt>c &lt; -0x50</tt>. If <tt>isdigit(UCHAR(c))</tt> is true, then <tt>c</tt> is between <tt>0x30</tt> and <tt>0x39</tt>, so <tt>c - '0'</tt> cannot overflow. Something else seems wrong. I do not know if declaring <tt>c</tt> as <tt>unsigned char</tt> (since <tt>char</tt> is signed by default on Darwin amd64) to avoid the <tt>-ftrapv</tt> exception is a good idea or just hides the problem. But I have not spotted any relevant changes since this issue was reported which may have resolved it.
    
    So far I cannot reproduce this issue with either <tt>-ftrapv</tt> or <tt>-fsanitize=signed-integer-overflow</tt> when I run these examples.
    
  2. login: "chrstphrchvz"
  3. mimetype: "text/x-fossil-wiki"