Segfault

I seem to have gotten another segfault, this time it is a bit different
output from gdb and I’m less certain that it is an infinite loop.

Maybe I’m using sscanf incorrectly, but it looks right to me:

  if strptr_isnot_null(linein) then let
    val x = 5
    var gene: string?
    var exp: double?
    var std: double?
    var resexp: double?
    var resstd: double?
    val _ = sscanf (linein, "%s\t%lf\t%lf", gene, exp, std) where {
    extern fun sscanf {l:agz} (s: !strptr l, format: string,
      gene: &string? >> string, exp: &double? >> double, 
      std: &double? >> double) :int = "mac#sscanf"    
    }

But I did see this warning (assume it is just how ATS deals with ambiguous
C types):

toCNF4_dats.c: In function ‘loopDATA_81’:
toCNF4_dats.c:4278:1: warning: format ‘%s’ expects argument of type ‘char
*’, but argument 3 has type ‘void **’ [-Wformat]

I’ve attached all files; too compile:

atscc -D_ATS_GCATS -o toCNF4 toCNF4.dats sstream.dats sstream.sats

To run:
./toCNF4 yn605.grRules ypeg_rf.expSTD

CNF4.zip (110 KB)

Please print out the value returned from sscanf and see if it is what you
expect.

gene: &string? >> string

is clearly incorrect. It should be something like

gene: &(@[byte?][N]) >> @[byte][N])

and N should be big enough.

How large should N be?