project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.39k stars 1.98k forks source link

[Telink] -Wundef errors in config headers #29593

Open bzbarsky-apple opened 1 year ago

bzbarsky-apple commented 1 year ago

Reproduction steps

Enable -Wundef. https://github.com/project-chip/connectedhomeip/actions/runs/6419947071/job/17430925696?pr=29582

INFO    ../../../../src/platform/telink/CHIPPlatformConfig.h:65:5: error: "CONFIG_PM" is not defined, evaluates to 0 [-Werror=undef]
INFO       65 | #if CONFIG_PM
INFO          |     ^~~~~~~~~
...
INFO    ../../../../src/system/SystemConfig.h:736:62: error: "CONFIG_NET_SOCKETS_POSIX_NAMES" is not defined, evaluates to 0 [-Werror=undef]
INFO      736 | #if CHIP_SYSTEM_CONFIG_USE_SOCKETS && defined(__ZEPHYR__) && CONFIG_NET_SOCKETS_POSIX_NAMES
INFO          |                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
INFO    cc1plus: note: unrecognized command-line option '-Wno-unknown-warning-option' may have been intended to silence earlier diagnostics

And also in https://github.com/project-chip/connectedhomeip/actions/runs/6419947054/job/17430927196?pr=29582

../../../../../../src/platform/Zephyr/ThreadStackManagerImpl.h:32:6: error: "CONFIG_SOC_SERIES_RISCV_TELINK_B9X" is not defined, evaluates to 0 [-Werror=undef]
   32 | #if !CONFIG_SOC_SERIES_RISCV_TELINK_B9X
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

which looks like Telink code breaking other platforms (in this case nrfconnect).

Are these headers failing to include something that would define the relevant macros?

Platform

other

Platform Version(s)

No response

Type

CI tested

(Optional) If manually tested please explain why this is only manually tested

No response

Anything else?

No response

bzbarsky-apple commented 1 year ago

@s07641069 See above.