From 5b5dceeb0dce6d4d428a699e689144fcde96fbbf Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Wed, 19 Oct 2022 13:15:56 +0530 Subject: [PATCH] fix: make sure that postject-api.h compiles without warnings Fixes the following error I came across while integrating Postject in Node.js: ```console ../deps/postject/src/dist/postject-api.h:30:13: error: unused function 'postject_options_init' [-Werror,-Wunused-function] static void postject_options_init(struct postject_options* options) { ^ 1 error generated. ``` Refs: https://github.com/nodejs/node/pull/45038 Signed-off-by: Darshan Sen --- postject-api.h | 2 +- test/CMakeLists.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/postject-api.h b/postject-api.h index 14899ee..104aa34 100644 --- a/postject-api.h +++ b/postject-api.h @@ -27,7 +27,7 @@ struct postject_options { const char* pe_resource_name; }; -static void postject_options_init(struct postject_options* options) { +inline void postject_options_init(struct postject_options* options) { options->elf_section_name = NULL; options->macho_framework_name = NULL; options->macho_section_name = NULL; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 45f78e6..eacb7a5 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 3.9) set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "-Wall -Werror") +set(CMAKE_C_FLAGS "-Wall -Werror") + project(postject-tests) add_executable(c_test test.c)