Skip to content
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

Treat build-time warnings as errors #72

Merged
merged 5 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
#include "em_cmu.h"
#include "em_wdog.h"
#include "em_rmu.h"
#include "sli_cpc_timer.h"
#include "sl_component_catalog.h"

void nc_enable_watchdog(void);
void nc_periodic_timer(sli_cpc_timer_handle_t *handle, void *data);
void nc_poke_watchdog(void);
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void nc_enable_watchdog(void)
}


void nc_poke_watchdog()
void nc_poke_watchdog(void)
{
CORE_DECLARE_IRQ_STATE;
CORE_ENTER_ATOMIC();
Expand Down
1 change: 1 addition & 0 deletions src/rcp-uart-802154/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <openthread/ncp.h>
#include <openthread/diag.h>
#include <openthread/tasklet.h>
#include <openthread/logging.h>

#include "openthread-system.h"
#include "app.h"
Expand Down
25 changes: 22 additions & 3 deletions tools/build_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,18 @@ def main():
LOGGER.warning(
"Component %s is not present in manifest, cannot remove", component
)
sys.exit(1)

# Extend configuration and C defines
for input_config, output_config in [
(manifest.get("configuration", {}), output_project.get("configuration", [])),
(manifest.get("slcp_defines", {}), output_project.get("define", [])),
(
manifest.get("configuration", {}),
output_project.setdefault("configuration", []),
),
(
manifest.get("slcp_defines", {}),
output_project.setdefault("define", []),
),
]:
for name, value in input_config.items():
# Values are always strings
Expand Down Expand Up @@ -542,6 +549,18 @@ def main():
LOGGER.error("Defines were unused, aborting: %s", unused_defines)
sys.exit(1)

# Fix Gecko SDK bugs
sl_rail_util_pti_config_h = args.build_dir / "config/sl_rail_util_pti_config.h"

# PTI seemingly cannot be excluded, even if it is disabled
if sl_rail_util_pti_config_h.exists():
sl_rail_util_pti_config_h.write_text(
sl_rail_util_pti_config_h.read_text().replace(
'#warning "RAIL PTI peripheral not configured"\n',
'// #warning "RAIL PTI peripheral not configured"\n',
)
)

# Remove absolute paths from the build for reproducibility
extra_compiler_flags = [
f"-ffile-prefix-map={str(src.absolute())}={dst}"
Expand All @@ -550,7 +569,7 @@ def main():
args.build_dir: "/src",
toolchain: "/toolchain",
}.items()
]
] + ["-Wall", "-Wextra", "-Werror"]

output_artifact = (args.build_dir / "build/debug" / base_project_name).with_suffix(
".gbl"
Expand Down
Loading