Skip to content

Commit

Permalink
Remove '-Wno-maybe-uninitialized' from compiler flags (#3797)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple authored and pull[bot] committed Jan 27, 2021
1 parent 304e82e commit 7486692
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
1 change: 0 additions & 1 deletion build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ config("disabled_warnings") {
cflags += [
"-Wno-psabi",
"-Wno-cast-function-type",
"-Wno-maybe-uninitialized",
]
}
}
Expand Down
12 changes: 5 additions & 7 deletions src/platform/qpg6100/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,16 @@ CHIP_ERROR BLEManagerImpl::_GetDeviceName(char * buf, size_t bufSize)

CHIP_ERROR BLEManagerImpl::_SetDeviceName(const char * devName)
{
CHIP_ERROR err;
CHIP_ERROR err = CHIP_NO_ERROR;

VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE);

if (mServiceMode == ConnectivityManager::kCHIPoBLEServiceMode_NotSupported)
{
return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
}
if (devName != nullptr && devName[0] != 0)
{
err = qvCHIP_BleSetDeviceName(devName);
}

exit:
return err;
}

Expand Down Expand Up @@ -230,13 +229,12 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUU
CHIP_ERROR err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;
bool isRxHandle;
uint16_t cId;
uint16_t dataLen;
uint16_t dataLen = data->DataLength();

VerifyOrExit(IsSubscribed(conId), err = CHIP_ERROR_INVALID_ARGUMENT);
ChipLogDetail(DeviceLayer, "Sending indication for CHIPoBLE TX characteristic (con %u, len %u)", conId, dataLen);

isRxHandle = UUIDsMatch(&chipUUID_CHIPoBLEChar_RX, charId);
dataLen = data->DataLength();
cId = qvCHIP_BleGetHandle(isRxHandle);

qvCHIP_TxData(conId, cId, dataLen, data->Start());
Expand Down
2 changes: 2 additions & 0 deletions third_party/efr32_sdk/efr32_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ template("efr32_sdk") {
cflags += [ "-isystem" + rebase_path(include_dir, root_build_dir) ]
}

cflags += [ "-Wno-maybe-uninitialized" ]

if (defined(invoker.defines)) {
defines += invoker.defines
}
Expand Down
1 change: 1 addition & 0 deletions third_party/lwip/lwip.gni
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ template("lwip_target") {
"-Wno-format",
"-Wno-type-limits",
"-Wno-unused-variable",
"-Wno-maybe-uninitialized",
]
}

Expand Down
11 changes: 11 additions & 0 deletions third_party/mbedtls/mbedtls.gni
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ template("mbedtls_target") {

_mbedtls_root = "${mbedtls_root}/repo"

config("${mbedtls_target_name}_warnings") {
cflags = [ "-Wno-maybe-uninitialized" ]
}

config("${mbedtls_target_name}_config") {
include_dirs = [ "${_mbedtls_root}/include" ]
}
Expand Down Expand Up @@ -106,6 +110,13 @@ template("mbedtls_target") {
sources += [ "${_mbedtls_root}/library/timing.c" ]
}

if (!defined(configs)) {
configs = []
}

# Relax warnings for third_party code.
configs += [ ":${mbedtls_target_name}_warnings" ]

if (!defined(public_configs)) {
public_configs = []
}
Expand Down

0 comments on commit 7486692

Please sign in to comment.