Skip to content

Commit

Permalink
Enable -Wundef by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple committed Oct 5, 2023
1 parent a75d2e5 commit cde780a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ config("strict_warnings") {
cflags = [
"-Wextra",
"-Wshadow",
"-Wundef",
"-Wunreachable-code",
"-Wvla",
"-Wformat",
Expand Down
6 changes: 3 additions & 3 deletions src/inet/InetInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ void CloseIOCTLSocket()
}
}

#if __ANDROID__
#ifdef __ANDROID__

static struct if_nameindex * backport_if_nameindex(void);
static void backport_if_freenameindex(struct if_nameindex *);
Expand Down Expand Up @@ -648,7 +648,7 @@ InterfaceIterator::~InterfaceIterator()
{
if (mIntfArray != nullptr)
{
#if __ANDROID__
#ifdef __ANDROID__
backport_if_freenameindex(mIntfArray);
#else
if_freenameindex(mIntfArray);
Expand All @@ -666,7 +666,7 @@ bool InterfaceIterator::Next()
{
if (mIntfArray == nullptr)
{
#if __ANDROID__
#ifdef __ANDROID__
mIntfArray = backport_if_nameindex();
#else
mIntfArray = if_nameindex();
Expand Down
4 changes: 4 additions & 0 deletions src/lib/support/CHIPArgParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
#include <stdio.h>
#include <stdlib.h>

#ifndef CHIP_CONFIG_NON_POSIX_LONG_OPT
#define CHIP_CONFIG_NON_POSIX_LONG_OPT 0
#endif

namespace chip {
namespace ArgParser {

Expand Down
4 changes: 2 additions & 2 deletions src/lib/support/UnitTestRegistration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ typedef struct

static test_suites_t gs_test_suites;

#if __ZEPHYR__
#ifdef __ZEPHYR__
inline static bool AlreadyExists(UnitTestTriggerFunction tests)
{
for (uint32_t i = 0; i < gs_test_suites.num_test_suites; ++i)
Expand All @@ -50,7 +50,7 @@ CHIP_ERROR RegisterUnitTests(UnitTestTriggerFunction tests)
return CHIP_ERROR_NO_MEMORY;
}

#if __ZEPHYR__
#ifdef __ZEPHYR__
// Not sure yet if it's a Zephyr bug or misconfiguration, but global constructors are called
// twice on native_posix platform - by libc and by Zephyr's main thread initialization code.
// This makes sure tests are not run twice for that reason.
Expand Down

0 comments on commit cde780a

Please sign in to comment.