This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug argparse/23983] New: Missing compat versions of argp_failure and argp_error for long double = double


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

            Bug ID: 23983
           Summary: Missing compat versions of argp_failure and argp_error
                    for long double = double
           Product: glibc
           Version: 2.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: argparse
          Assignee: unassigned at sourceware dot org
          Reporter: gabriel at inconstante dot eti.br
  Target Milestone: ---

Created attachment 11461
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11461&action=edit
Reproducer

Since Glibc 2.4, the default format of the long double type was changed from
the same as double to a different, wider format, on several platforms, e.g.
powerpc and s390.

The previous format is meant to be accessible with the use of the
"-mlong-double-64" compiler option.  However, backwards-compatible versions of
the argp_error and argp_failure functions (from argp.h) were never provided,
which causes code compiled with -mlong-double-64 to incorrectly print long
double values.  For instance, the attached code (based on argp/tst-ldbl-argp.c)
produces the following, incorrect output on a powerpc machine with Ubuntu
16.04:

$ gcc -mlong-double-64 tst-ldbl-argp.c && ./a.out
test-argp: 1.000000 -- 0.000000

When it produces correct output with "-mlong-double-128":

$ gcc -mlong-double-128 tst-ldbl-argp.c && ./a.out
test-argp: 1.000000 -- 2.000000

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]