Bug 15007 - stdlib/bits/stdlib-ldbl.h: mismatch of guards around qecvt & friends
Summary: stdlib/bits/stdlib-ldbl.h: mismatch of guards around qecvt & friends
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.17
: P2 normal
Target Milestone: ---
Assignee: Andreas Jaeger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-09 13:38 UTC by Dennis Schridde
Modified: 2014-06-13 19:05 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments
glibc-2.16.0-stdlib-ldbl-qecvt.patch (256 bytes, patch)
2013-01-09 13:38 UTC, Dennis Schridde
Details | Diff
glibc-2.17-stdlib-ldbl-qecvt.patch (258 bytes, patch)
2013-03-30 15:12 UTC, Dennis Schridde
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Schridde 2013-01-09 13:38:30 UTC
Created attachment 6805 [details]
glibc-2.16.0-stdlib-ldbl-qecvt.patch

libtool: compile:  powerpc64-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../include -I../include/opensm -I./../include -Wall -g -D_XOPEN_SOURCE=6
00 -D_BSD_SOURCE=1 -pipe -O2 -mcpu=cell -mabi=altivec -mgen-cell-microcode -c cl_dispatcher.c  -fPIC -DPIC -o .libs/libosmcomp_la-cl_dispatcher.o
In file included from /usr/include/stdlib.h:960:0,
                 from cl_dispatcher.c:46:
/usr/include/bits/stdlib-ldbl.h:35:1: error: 'qecvt' undeclared here (not in a function)
/usr/include/bits/stdlib-ldbl.h:36:1: error: 'qfcvt' undeclared here (not in a function)
/usr/include/bits/stdlib-ldbl.h:37:1: error: 'qgcvt' undeclared here (not in a function)
/usr/include/bits/stdlib-ldbl.h:38:1: error: 'qecvt_r' undeclared here (not in a function)
/usr/include/bits/stdlib-ldbl.h:39:1: error: 'qfcvt_r' undeclared here (not in a function)

The problem was caused by mismatching #ifdef guards: The reference in stdlib-ldbl.h was guarded by "defined __USE_SVID || defined __USE_XOPEN_EXTENDED" while stdlib.h guarded the declaration with "(defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) || defined __USE_SVID". Apparently __USE_XOPEN2K is defined in my case.

Attached patch fixes the issue.
Comment 1 jsm-csl@polyomino.org.uk 2013-01-09 17:32:54 UTC
On Wed, 9 Jan 2013, devurandom at gmx dot net wrote:

>   --> http://sourceware.org/bugzilla/attachment.cgi?id=6805
> glibc-2.16.0-stdlib-ldbl-qecvt.patch

The conditions on these functions in stdlib.h changed in 2.17 to fix bug 
14824, so a patch to stdlib-ldbl.h will need to match the current fixed 
version of stdlib.h rather than an older version.

Please send patches to libc-alpha@sourceware.org - with [BZ #15007] in the 
ChangeLog entry to reference this bug.
Comment 2 Dennis Schridde 2013-03-30 15:12:15 UTC
Created attachment 6962 [details]
glibc-2.17-stdlib-ldbl-qecvt.patch

(In reply to comment #1)
> The conditions on these functions in stdlib.h changed in 2.17 to fix bug 
> 14824, so a patch to stdlib-ldbl.h will need to match the current fixed 
> version of stdlib.h rather than an older version.

Attached patch was created against glibc-2.17, but it looks exactly the same as the old patch - apparently the change of conditions was reverted before release.
Comment 3 Andreas Jaeger 2013-04-03 16:51:03 UTC
devurandom, could you give me your full name for a ChangeLog entry, please?
Comment 4 Dennis Schridde 2013-04-03 17:23:16 UTC
(In reply to comment #3)
> devurandom, could you give me your full name for a ChangeLog entry, please?

Dennis Schridde

Thanks for the credit. :)
Comment 5 Andreas Jaeger 2013-04-27 14:24:58 UTC
We fixed this slightly different now for glibc 2.18 with this commit:

commit 4220c3ef773c0e7fff7c95ecd7cff69886fe4c0e
Author: Andreas Jaeger <aj@suse.de>
Date:   Sat Apr 27 16:17:55 2013 +0200

    Fix guards for qecvt
    
        [BZ #15007]
        * stdlib/stdlib.h: Update guards for qecvt.
        * stdlib/bits/stdlib-ldbl.h: Sync guards for qecvt etc with
        <stdlib.h>.


Thanks for the report, Andreas