From b8083908a736c96b89990380a57a92e4a98600f8 Mon Sep 17 00:00:00 2001 From: Robert May Date: Sun, 1 Nov 2015 19:23:47 +0000 Subject: [PATCH] Correct warnings supression in more obvious way Whilst a little more invasive change than the previous warnings supression this is more correct and more obvious as to what's being done, and what warnigns will remain in place for the rest of the comilation unit. --- source/MicroBitThermometer.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/source/MicroBitThermometer.cpp b/source/MicroBitThermometer.cpp index 094572b..23163bd 100644 --- a/source/MicroBitThermometer.cpp +++ b/source/MicroBitThermometer.cpp @@ -1,19 +1,22 @@ #include "MicroBit.h" /** - * Turn off unused-parameter warnings under gcc -Wall - * This turns them off for the entire compilation unit - * (i.e. the whole of this file) as the compiler can't - * tell that a parameter is unused until the end, and - * so we can't just turn it off as a guard around the - * next include. - * It might be better to add + * Turn off warnings under gcc -Wall + * We turn off unused-function for the entire compilation + * unit as the compiler can't tell if a function is + * unused until the end of the unit. The macro + * expansion for SVCALL() in nrf_soc.h and nrf_srv.h + * tries to leave unused-function turned off, but + * It might be leaner to add * #pragram GCC system header * as the first line of nrf_soc.h, but that's a different * module ... */ +#pragma GCC diagnostic ignored "-Wunused-function" +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #include "nrf_soc.h" +#pragma GCC diagnostic pop /** * Constructor.