-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Compiler warnings checks and fixes #316
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,7 @@ target_compile_options(kitchen_sink_options INTERFACE | |
-Wfloat-equal | ||
-Wmissing-format-attribute | ||
-Wconversion | ||
-Wsign-compare | ||
$<$<COMPILE_LANGUAGE:C>:-Wstrict-prototypes> | ||
|
||
-Wno-inline | ||
|
@@ -85,7 +86,7 @@ target_compile_options(kitchen_sink_options INTERFACE | |
) | ||
|
||
target_compile_definitions(kitchen_sink_libs INTERFACE | ||
NDEBUG | ||
PARAM_ASSERTIONS_ENABLE_ALL=1 # want to check all the assertions for compilation warnings | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Haha, I'd never noticed that this file is manually specifying There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yup; i have no idea why that was like that :-) |
||
PICO_AUDIO_DMA_IRQ=1 | ||
) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,18 +5,44 @@ | |
*/ | ||
|
||
#include <stdio.h> | ||
#include "pico/stdlib.h" | ||
#include "pico/time.h" | ||
// Include all headers to check for compiler warnings | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it worth having a build-time script do this automatically, as it's likely that additional headers will get added to the SDK in future? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Partially added in #319 🙂 |
||
#include "hardware/adc.h" | ||
#include "hardware/claim.h" | ||
#include "hardware/clocks.h" | ||
#include "hardware/divider.h" | ||
#include "hardware/dma.h" | ||
#include "pico/bit_ops.h" | ||
#include "hardware/flash.h" | ||
#include "hardware/gpio.h" | ||
#include "hardware/i2c.h" | ||
#include "hardware/pwm.h" | ||
#include "hardware/pio.h" | ||
#include "hardware/interp.h" | ||
#include "hardware/irq.h" | ||
#include "hardware/pio.h" | ||
#include "hardware/pll.h" | ||
#include "hardware/pwm.h" | ||
#include "hardware/resets.h" | ||
#include "hardware/rtc.h" | ||
#include "hardware/spi.h" | ||
#include "hardware/sync.h" | ||
#include "hardware/timer.h" | ||
#include "pico/divider.h" | ||
#include "pico/critical_section.h" | ||
#include "hardware/uart.h" | ||
#include "hardware/vreg.h" | ||
#include "hardware/watchdog.h" | ||
#include "hardware/xosc.h" | ||
#include "pico/binary_info.h" | ||
#include "pico/bit_ops.h" | ||
#include "pico/bootrom.h" | ||
#include "pico/divider.h" | ||
#include "pico/double.h" | ||
#include "pico/fix/rp2040_usb_device_enumeration.h" | ||
#include "pico/float.h" | ||
#include "pico/int64_ops.h" | ||
#include "pico/malloc.h" | ||
#include "pico/multicore.h" | ||
#include "pico/printf.h" | ||
#include "pico/stdlib.h" | ||
#include "pico/sync.h" | ||
#include "pico/time.h" | ||
#include "pico/unique_id.h" | ||
|
||
bi_decl(bi_block_device( | ||
BINARY_INFO_MAKE_TAG('K', 'S'), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a) it probably makes sense to list these in the same order they're listed in the enum? (i.e. swap round
PWM_DIV_B_RISING
andPWM_DIV_B_HIGH
)b) as this is a multi-line chunk of code repeated in both
pwm_config_set_clkdiv_mode
andpwm_set_clkdiv_mode
it's probably worth factoring it out to an(other) inline function?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a) don't care enough to change it.
b) thought about it at the time, but decided against because it is non functional code... and i was just working around a compiler limitation