Comments (7)
If you add
should_skip_normalization = true;
within the if (abs_number == 0.0) {
block (line 629), does that make the warning go away?
from printf.
No, the warning remains.
The if block at 630-658 will either assign exp10=0, or assign a value to normalization.raw_factor. With exp10==0 the should_skip_normalization boolean will be true, and get_normalized_components() will not be executed.
So the warning is not a real threat. I propose we just add an initializer to the declaration of 'normalization' on line 625.
from printf.
from printf.
Michael, please don't reply with a huge quotation block, that's useless for these bug pages. Just your reply, and nothing else please...
from printf.
Do we know if the warning is a real threat?
We know that it is not. normalization
is only used if it is initialized. It's a compiler bug for not noticing this.
maybe we just init on line 625 in it's declaration?
I would rather not initialize normalization, since that implies the initializer values might actually get used, which is not the case. Is AVR-GCC special somehow? Is there a precompiler definition I could use to identify it to special-case it?
from printf.
@mickjc750 : ping.
from printf.
So, this is a compiler bug. The value cannot be used uninitialized. MSVC also fails to realize this.
Closing for now.
from printf.
Related Issues (20)
- is there a API to printf vector? HOT 1
- I want to add support for vector format HOT 3
- Possible NULL pointer dereference HOT 9
- Precision not honoured in large double HOT 3
- Rounding-Error: Use proper banker's rounding HOT 4
- Rename `rounding_threshold` to `one_half`
- printf("%# 01.1g", 9.8) results in many 0's due to underflow HOT 1
- printf("%# 01.1g", 9.8) yields decimal rather than exponential formatting HOT 9
- printf still bigger in size compared to stdio printf HOT 14
- print_exponential_number()'s variable "abs_exp10_covered_by_powers_table" may be really uninitialized HOT 1
- suspisious code vs comment HOT 1
- Failing to install a prinf-config.cmake file
- Compiler warning triggered when compiling without -Wmaybe-uninitialized
- Incorrect size assumption for size_t on 16-bit target (msp430). HOT 7
- Two problems about the get_components function HOT 3
- Support long double values HOT 1
- Enable C89 support HOT 11
- Use BUILD_SHARED_LIBS for choosing between static and shared build
- Wrong output of denormalized numbers HOT 4
- float autotest failures HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from printf.