delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/05/28/11:53:38

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:mime-version
:content-type:content-transfer-encoding; q=dns; s=default; b=BDA
wZxJAEyOygO4zzwCYGkOLQWSrOUxVxr9DAlRXrJfZNmcehBYp34uETzQxK/gPB5C
0293rcexcAdMgDaeDT6dC63VdDfOcc9xOuoxXV9mzi0n+v45qHCPQoyyXOv4JLcK
udE3yUdLf++4/Xu8EJ3rsY/Ccsd9MI93MJl23pF0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:mime-version
:content-type:content-transfer-encoding; s=default; bh=VXSm+6bvY
3Kk93VIAbbQXVJ6njQ=; b=sbA8pJriyKb48Bu8LGJaDkN98k/oG+lY3KWVzGPzP
vPPURR5C+L8k+L+yxX31d6VqV92oZgbBjh8o19e2rRzAMNTjfD6CLat6VEcfqh4C
ScYPtKrsjxm2eyFYqIyYo2uZaPubvV73UOsSMXcb5/glEIet4yxIruDbY46wkS76
+o=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=0.7 required=5.0 tests=AWL,BAYES_40,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2
X-HELO: nm19-vm6.access.bullet.mail.gq1.yahoo.com
X-Yahoo-SMTP: 0z5TJLmswBDohOc2QznCIeoaEiEalQiTSMLFNdKdTt4t
X-Rocket-Received: from 2600kPC (aschwarz1309 AT 75 DOT 22 DOT 34 DOT 23 with plain [67.195.15.5]) by smtp117.sbc.mail.gq1.yahoo.com with SMTP; 28 May 2014 15:53:18 +0000 UTC
From: "Arthur Schwarz" <aschwarz1309 AT att DOT net>
To: <cygwin AT cygwin DOT com>
Subject: gcc 4.8.2 runtime library error
Date: Wed, 28 May 2014 08:53:08 -0700
Message-ID: <A8D6723F31474D8D8B1D6589BDC1113B@2600kPC>
MIME-Version: 1.0

Win 7 64-bit
gcc 4.8.2 (64-bit)

ret: http://stackoverflow.com/questions/23900921/c-scanf-la-returns-0

I don't know whether cygwin or gcc.org maintains the runtime library. If
this is the wrong location I'll redirect this e-mail.

sscanf() doesn't handle "%la" correctly and crashes on "%a". 

Sample code and output:
# include <stdio.h>
# include <ios>
# include <iostream>
# include <iomanip>

#include <cstdlib>

using namespace std;
int main(int argc, char** argv) {
   char buffer[30];
   double x = 5.0;
   sprintf(buffer, "%a", 1.2);
   sscanf(buffer, "%la", &x);
   cout << "    Example 1.2 buffer -> " << buffer << endl;
   cout << "    Example 1.2 scanf <- " << x << endl;

   return 0;
}
output 
 Example 1.2 buffer -> 0x1.3333333333333p+0
 Example 1.2 scanf <- 0



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019