Skip to content

Commit 42f5769

Browse files
authored
Merge pull request #21649 from gschorcht/fix_ndebug_problems
tests: fix compilation problems with NDEBUG
2 parents 38ff4fe + 2e72d04 commit 42f5769

File tree

26 files changed

+58
-37
lines changed

26 files changed

+58
-37
lines changed

cpu/esp32/periph/i2c_hw.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ void i2c_init(i2c_t dev)
171171
default:
172172
LOG_TAG_ERROR("i2c", "Invalid speed value in %s\n", __func__);
173173
assert(0);
174+
return;
174175
}
175176

176177
_i2c_bus[dev].clk_freq = clk_speed;

cpu/rpx0xx/periph/pwm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ uint32_t pwm_init(pwm_t pwm, pwm_mode_t mode, uint32_t freq, uint16_t res)
112112

113113
uint8_t pwm_channels(pwm_t pwm)
114114
{
115+
(void)pwm; /* avoid compilation problems with NDEBUG */
115116
assert(pwm < PWM_NUMOF);
116117
return PWM_CHANNEL_NUMOF;
117118
}

drivers/cst816s/cst816s_touch_dev.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ uint16_t _cst816s_height(const touch_dev_t *touch_dev)
4343
{
4444
const cst816s_t *dev = (const cst816s_t *)touch_dev;
4545
assert(dev);
46+
(void)dev; /* avoid compilation problems with NDEBUG */
4647

4748
return CST816S_YMAX;
4849
}
@@ -51,6 +52,7 @@ uint16_t _cst816s_width(const touch_dev_t *touch_dev)
5152
{
5253
const cst816s_t *dev = (const cst816s_t *)touch_dev;
5354
assert(dev);
55+
(void)dev; /* avoid compilation problems with NDEBUG */
5456

5557
return CST816S_XMAX;
5658
}

drivers/soft_spi/soft_spi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ int soft_spi_init_cs(soft_spi_t bus, soft_spi_cs_t cs)
101101
return SOFT_SPI_OK;
102102
}
103103

104+
MAYBE_UNUSED
104105
static inline int soft_spi_mode_is_valid(soft_spi_mode_t mode)
105106
{
106107
if ((mode != SOFT_SPI_MODE_0) && (mode != SOFT_SPI_MODE_1) &&

drivers/ws281x/esp32.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ static uint8_t _rmt_channel(ws281x_t *dev)
6464
}
6565
}
6666
assert(0);
67+
return 0; /* avoid compilation problems with NDEBUG */
6768
}
6869
#endif
6970

pkg/cifra/psa_cifra/aes_ccm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ psa_status_t psa_aead_encrypt_aes_ccm(const psa_key_attributes_t *attributes,
2828
size_t nonce_length, const uint8_t *additional_data,
2929
size_t additional_data_length, const uint8_t *plaintext,
3030
size_t plaintext_length, uint8_t *ciphertext,
31-
size_t ciphertext_size, size_t *ciphertext_length)
31+
MAYBE_UNUSED size_t ciphertext_size,
32+
size_t *ciphertext_length)
3233
{
3334
(void)attributes;
3435
/* This should already have been checked by PSA. */

pkg/driver_cryptocell_310/psa_cryptocell_310/aes_ccm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ psa_status_t psa_aead_aes_128_ccm_encrypt(const psa_key_attributes_t *attributes
3838
(void)key_buffer_length;
3939
/* This should already have been checked by PSA. */
4040
assert(ciphertext_size >= plaintext_length + tag_length);
41+
(void)ciphertext_size; /* avoid compilation problems with NDEBUG */
4142

4243
if (!cryptocell_310_data_within_ram(nonce) ||
4344
!cryptocell_310_data_within_ram(key_buffer) ||

pkg/tinyvcdiff/contrib/tinyvcdiff_mtd/mtd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ static int _write (void *dev, uint8_t *src, size_t offset, size_t len)
9999
vcdiff_mtd_t *mtd = dev;
100100

101101
assert(offset == mtd->offset);
102+
(void)offset; /* avoid compilation problems with NDEBUG */
102103

103104
DEBUG("_write: 0x%" PRIxSIZE " + %" PRIuSIZE "B\n", mtd->offset, len);
104105

pkg/uwb-core/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ ifneq (,$(filter llvm,$(TOOLCHAIN)))
2424
CFLAGS += -Wno-microsoft-anon-tag
2525
endif
2626

27+
ifneq (,$(filter -DNDEBUG,$(CFLAGS)))
28+
CFLAGS += -Wno-sometimes-uninitialized
29+
endif
30+
2731
IGNORE_MODULES := uwb-core_dpl \
2832
uwb-core_config \
2933
uwb-core_contrib \

pkg/uwb-dw1000/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,9 @@ ifneq (,$(filter llvm,$(TOOLCHAIN)))
2424
CFLAGS += -Wno-microsoft-anon-tag
2525
endif
2626

27+
ifneq (,$(filter -DNDEBUG,$(CFLAGS)))
28+
CFLAGS += -Wno-sometimes-uninitialized
29+
endif
30+
2731
all:
2832
$(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR)/hw/drivers/uwb/uwb_dw1000/src -f $(RIOTPKG)/uwb-dw1000/uwb-dw1000.mk MODULE=uwb-dw1000

0 commit comments

Comments
 (0)