-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix(QPG): Enable -Wundef and fix any errors for qpg based builds #29617
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 |
---|---|---|
|
@@ -113,6 +113,15 @@ | |
#define CHIP_DEVICE_CONFIG_ENABLE_SED 0 | ||
#endif | ||
|
||
/** | ||
* @def CHIP_DEVICE_CONFIG_ENABLE_SSED | ||
* | ||
* @brief Defines if a matter device is acting as a Synchronized Sleepy End Device(SSED) | ||
*/ | ||
#ifndef CHIP_DEVICE_CONFIG_ENABLE_SSED | ||
#define CHIP_DEVICE_CONFIG_ENABLE_SSED 0 | ||
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. This is fine, but really this should have gone in CHIPDeviceConfig.h (the core one)... I suspect it will get added there as part of #29613 |
||
#endif | ||
|
||
/** | ||
* @def CHIP_DEVICE_CONFIG_THREAD_FTD | ||
* | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,11 +45,11 @@ | |
#include <lib/support/logging/CHIPLogging.h> | ||
#include <platform/CHIPDeviceLayer.h> | ||
|
||
#if PW_RPC_ENABLED | ||
#if defined(PW_RPC_ENABLED) && PW_RPC_ENABLED | ||
#include "Rpc.h" | ||
#endif // PW_RPC_ENABLED | ||
|
||
#if ENABLE_CHIP_SHELL | ||
#if defined(ENABLE_CHIP_SHELL) && ENABLE_CHIP_SHELL | ||
#include "shell_common/shell.h" | ||
#endif // ENABLE_CHIP_SHELL | ||
|
||
|
@@ -142,7 +142,7 @@ CHIP_ERROR CHIP_Init(void) | |
{ | ||
CHIP_ERROR ret = CHIP_NO_ERROR; | ||
|
||
#if PW_RPC_ENABLED | ||
#if defined(PW_RPC_ENABLED) && PW_RPC_ENABLED | ||
ret = (CHIP_ERROR) chip::rpc::Init(); | ||
if (ret != CHIP_NO_ERROR) | ||
{ | ||
|
@@ -158,7 +158,7 @@ CHIP_ERROR CHIP_Init(void) | |
goto exit; | ||
} | ||
|
||
#if ENABLE_CHIP_SHELL | ||
#if defined(ENABLE_CHIP_SHELL) && ENABLE_CHIP_SHELL | ||
ret = (CHIP_ERROR) ShellTask::Start(); | ||
if (ret != CHIP_NO_ERROR) | ||
{ | ||
|
@@ -184,7 +184,7 @@ CHIP_ERROR CHIP_Init(void) | |
goto exit; | ||
} | ||
|
||
#if CONFIG_CHIP_THREAD_SSED | ||
#if defined(CHIP_DEVICE_CONFIG_ENABLE_SSED) && CHIP_DEVICE_CONFIG_ENABLE_SSED | ||
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. This on the other hand looks wrong. There is no CHIP_DEVICE_CONFIG_ENABLE_SSED so far (before this PR). What we do have is CHIP_DEVICE_CONFIG_THREAD_SSED on some platforms and CONFIG_CHIP_THREAD_SSED on some platforms, and it's a bit of a mess. But generally:
The setup here, where I know the config header setup is really weird; I am only now starting to finally understand how it works. But the above is how it should work. ;) |
||
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SynchronizedSleepyEndDevice); | ||
qvIO_EnableSleep(true); | ||
#elif CHIP_DEVICE_CONFIG_ENABLE_SED | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1710,7 +1710,7 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread<ImplClass>::DoInit(otInstanc | |
VerifyOrExit(otErr == OT_ERROR_NONE, err = MapOpenThreadError(otErr)); | ||
|
||
// Enable automatic assignment of Thread advertised addresses. | ||
#if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE | ||
#if defined(OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE) && OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE | ||
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. Again, ideally there would be a specific config header responsible for this that we ensured we included. In practice people put this define in all sorts of random places: project-specific OpenThreadConfig.h, platform-specific CHIPDevicePlatformConfig.h, some So as far as I can tell, this change is just covering up a bug: we are not including the things that might define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE in this file. 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. Follow up created - #29624 |
||
otIp6SetSlaacEnabled(otInst, true); | ||
#endif | ||
|
||
|
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.
I guess the semantics of this macro (boolean value vs just-defined-or-not) are per-platform, so it's OK that this is not necessarily going to be consistent with other platforms?