From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1013 invoked by alias); 21 Sep 2007 19:16:15 -0000 Received: (qmail 961 invoked by uid 48); 21 Sep 2007 19:16:06 -0000 Date: Fri, 21 Sep 2007 19:16:00 -0000 Subject: [Bug c++/33521] New: -m128bit-long-double and printf don't mix X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "Raf_Schietekat at ieee dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-09/txt/msg01788.txt.bz2 [#include // EXIT_SUCCESS #include // printf int main(int argc, char** argv) { long double ld = 1.0; printf("ld = %Lg, string = %s\n", ld, "foo"); return (EXIT_SUCCESS); }] [g++ -m128bit-long-double -Wall main.cpp -o test && ./test] With the wider long double, a corrupted value is printed at %s. If the ld declaration is changed to [long double ld = 1.0, lda[10];], nothing is printed, and if the declaration is changed to [long double ld = 1.0, lda[10000];], "(null)" is printed (without the quotes). If the -m128bit-long-double flag is omitted, or if the %Lg is omitted (and its corresponding argument), no problems occur (although I have not tested all 12 combinations). If this shouldn't be tried at all (printf is in a library that was compiled with normal-width long doubles), it would be nice to at least have a warning about it, but there seems to be more than that going on. I may have no further interest in this issue, which was encountered during some experiments. -- Summary: -m128bit-long-double and printf don't mix Product: gcc Version: 4.1.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: Raf_Schietekat at ieee dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33521