bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/18669] New: libiberty demangle.test failure: strtod() on s


From: saper at marcincieslak dot com
Subject: [Bug binutils/18669] New: libiberty demangle.test failure: strtod() on sparc-sun-solaris2.9 does not accept hexadecimal numbers
Date: Tue, 14 Jul 2015 09:54:32 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=18669

            Bug ID: 18669
           Summary: libiberty demangle.test failure: strtod() on
                    sparc-sun-solaris2.9 does not accept hexadecimal
                    numbers
           Product: binutils
           Version: 2.26 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: saper at marcincieslak dot com
  Target Milestone: ---

The use of strtod() has been introduced in place of strtold() that does not
exist in Solaris 9:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=5af04e20f6333dc224d1668dcd433d7c8ca84e71

C++ demangling test fails on the sparc-sun-solaris2.9 machine:

./test-demangle < ./d-demangle-expected
FAIL at line 670, options --format=dlang:
in:  _D8demangle17__T4testVde0A8P6Zv
out: (null)
exp: demangle.test!(42.0000)
FAIL at line 674, options --format=dlang:
in:  _D8demangle16__T4testVdeA8P2Zv
out: (null)
exp: demangle.test!(42.0000)
FAIL at line 678, options --format=dlang:
in:  _D8demangle18__T4testVdeN0A8P6Zv
out: (null)
exp: demangle.test!(-42.0000)
FAIL at line 682, options --format=dlang:
in:  _D8demangle31__T4testVde0F6E978D4FDF3B646P7Zv
out: (null)
exp: demangle.test!(123.456)
FAIL at line 698, options --format=dlang:
in:  _D8demangle23__T4testVfe0FFFFFFP128Zv
out: (null)
exp: demangle.test!(3.40282e+38)
FAIL at line 702, options --format=dlang:
in:  _D8demangle32__T4testVde0FFFFFFFFFFFFF8P1024Zv
out: (null)
exp: demangle.test!(1.79769e+308)
FAIL at line 706, options --format=dlang:
in:  _D8demangle19__T4testVfe08PN125Zv
out: (null)
exp: demangle.test!(1.17549e-38)
FAIL at line 710, options --format=dlang:
in:  _D8demangle20__T4testVde08PN1021Zv
out: (null)
exp: demangle.test!(2.22507e-308)
FAIL at line 714, options --format=dlang:
in:  _D8demangle51__T4testVrc0C4CCCCCCCCCCCCCDP4c0B666666666666666P6Zv
out: (null)
exp: demangle.test!(12.3000+45.6000i)
FAIL at line 718, options --format=dlang:
in:  _D8demangle52__T4testVrcN0C4CCCCCCCCCCCCCDP4c0B666666666666666P6Zv
out: (null)
exp: demangle.test!(-12.3000+45.6000i)
FAIL at line 738, options --format=dlang:
in:  _D8demangle25__T4testVAdA2e08P1eN08P1Zv
out: (null)
exp: demangle.test!([1.00000, -1.00000])
./test-demangle: 230 tests, 11 failures
make: *** [check-d-demangle] Error 1

This is because Solaris 9 strtod() complies to SUSv2 and does not accept
hexadecimal parameters; see Application Usage section of POSIX:

http://pubs.opengroup.org/onlinepubs/9699919799/toc.htm

This simple test program:

#include <stdlib.h>
#include <stdio.h>
#include <errno.h>

double strtod(const char *str, char **endptr);

int
main()
{
        double a;
        char *endptr;
        int c;
        errno = 0;
        a = strtod("0x0A8P6Zv", &endptr);
        c = errno;
        fprintf(stderr, "endptr = %s\n", endptr);
        fprintf(stderr, "a  = %g, errno = %d\n", a, c);
        return 0;
}

produces

endptr = x0A8P6Zv
a  = 0, errno = 0

on modern systems is produces

endptr = Zv
a  = 10752, errno = 0

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]