This is the mail archive of the
cygwin
mailing list for the Cygwin project.
gcc 4.8.2 runtime library error
- From: "Arthur Schwarz" <aschwarz1309 at att dot net>
- To: <cygwin at cygwin dot com>
- Date: Wed, 28 May 2014 08:53:08 -0700
- Subject: gcc 4.8.2 runtime library error
- Authentication-results: sourceware.org; auth=none
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