scanf issue when parsing 0.0xx to get a double

Bug #1705048 reported by Fulvio Boggia on 2017-07-18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain
Fulvio Boggia

Bug Description

I did a lot of tests and came to this issue. When a string contains a number that starts with 0.0 and I want to put its value in a double, the scanf does not return anymore.

Here a sample code:

  double test_dbl;

  sscanf( "0.01", "%lf", &test_dbl);

If I use a float instead of a double, it works:

  float test_flt;

  sscanf( "0.01", "%f", &test_flt);

My ARM architecture is ARM9. Options used for compiler (but it is a lib issue):

-c -Os -g -gdwarf-2 -mcpu=arm946e-s -mtune=arm946e-s -march=armv5te -mfloat-abi=soft -mthumb-interwork -fomit-frame-pointer -fno-exceptions -ffast-math -fno-common -funroll-loops -mlong-calls -mlittle-endian -ffunction-sections -fdata-sections

Options used for linker:

-Wl,--cref -Wl,--no-warn-mismatch -Wl,--gc-section --specs=nano.specs -u _printf_float -u _scanf_float

Tested with GAE 2014q2, 2014q3, 2017q2 original exe.

Fulvio Boggia (fubo73) wrote :

Issue does not exist. I noticed that in some cases scanf calls sprintf, and my implementation of retargeting was not allowing calls between library APIs.

Changed in gcc-arm-embedded:
assignee: nobody → Fulvio Boggia (fubo73)
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers