-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Clang fixes when building without -ffreestanding #56396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
39b969e to
bc2af9f
Compare
|
The following west manifest projects have been modified in this Pull Request:
Note: This message is automatically posted and updated by the Manifest GitHub Action. |
65624bb to
d9f7ba0
Compare
|
This depends on pr #56489 |
It's merged now |
Thanks! |
|
@keith-packard could you update this PR to remove the change to |
This case takes a float value and passes it to the integer abs function, storing the result in an integer type variable. That looks like a possible error to clang, so insert an explicit cast to int to make the compiler happy. Signed-off-by: Keith Packard <keithp@keithp.com>
C only permits labels on statements, not declarations. Separate the declarations from the assignments so that the labels can target statements instead. Signed-off-by: Keith Packard <keithp@keithp.com>
Clang complains when an unsigned value is passed to abs, even though there is an implicit cast to a signed type. Insert an explicit cast to make clang happy. Signed-off-by: Keith Packard <keithp@keithp.com>
Clang detects a value of the wrong size passed to printf with %h or %hh modifiers. Insert explicit casts to the expected type. Signed-off-by: Keith Packard <keithp@keithp.com>
d9f7ba0 to
9c07fb3
Compare
done. |
9c07fb3 to
53b99d4
Compare
PR #54638 proposes eliminating -ffreestanding when building with a C library other than the minimal C library. When building in this mode, clang finds a number of things to complain about in the code, including calls to abs with unsigned/float values and inappropriate types to printf.
This series also includes a C language conformance fix -- code using labels on declarations, which is not valid.