From 0587f5b9647ff8bd065659425072dc7560d4ea12 Mon Sep 17 00:00:00 2001 From: Simon Arlott <70171+nomis@users.noreply.github.com> Date: Sat, 17 Aug 2019 19:07:37 +0100 Subject: [PATCH] Add __attribute__((unused)) to generated test code (#2906) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this, the compiler will generate unused parameter warnings in the native version: test/output_export.cpp: In function ‘void output_start(unsigned int)’: test/output_export.cpp:6:32: error: unused parameter ‘baudrate’ [-Werror=unused-parameter] void output_start(unsigned int baudrate) ^~~~~~~~ cc1plus: all warnings being treated as errors --- platformio/commands/test/processor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platformio/commands/test/processor.py b/platformio/commands/test/processor.py index e1a141c4..085ffb2c 100644 --- a/platformio/commands/test/processor.py +++ b/platformio/commands/test/processor.py @@ -148,7 +148,11 @@ class TestProcessorBase(object): "", "$object", "", + "#ifdef __GNUC__", + "void output_start(unsigned int baudrate __attribute__((unused)))", + "#else", "void output_start(unsigned int baudrate)", + "#endif", "{", " $begin;", "}",