Comment 1 for bug 1341125

Revision history for this message
Fabrizio Gennari (fabrizio-ge) wrote :

After further investigation it seems that gdb assumes that floating-point numbers use . as decimal mark, as these lines from c-exp.y show

            else if (!got_dot && *p == '.')
              got_dot = 1;

but, later, the function parse_float() (in parse.c) feeds the string into sscanf

  num = sscanf (copy, "%" DOUBLEST_SCAN_FORMAT "%n", d, &n);

and, apparently, sscanf is locale-sensitive, so, if the current locale has , as decimal mark, sscanf will leave everything past the . sign unscanned. gdb, then, notices that something is unscanned and says "invalid number"