From fb5e53e1e4778b6f161a6bdac8c1e543e891c492 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 1 Jan 2015 18:55:11 +1100 Subject: [PATCH] AP_Param: cope with older gcc versions Travis-CI uses 4.6.3 --- libraries/AP_Param/AP_Param.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libraries/AP_Param/AP_Param.cpp b/libraries/AP_Param/AP_Param.cpp index c2d3160a16..20d1fd825a 100644 --- a/libraries/AP_Param/AP_Param.cpp +++ b/libraries/AP_Param/AP_Param.cpp @@ -1089,6 +1089,8 @@ void AP_Param::show_all(AP_HAL::BetterStream *port) } } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" // convert one old vehicle parameter to new object parameter void AP_Param::convert_old_parameter(const struct ConversionInfo *info) { @@ -1116,10 +1118,7 @@ void AP_Param::convert_old_parameter(const struct ConversionInfo *info) AP_Param *ap2; ap2 = find_P((const prog_char_t *)&info->new_name[0], &ptype); if (ap2 == NULL) { -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat" hal.console->printf_P(PSTR("Unknown conversion '%S'\n"), info->new_name); -#pragma GCC diagnostic pop return; } @@ -1149,12 +1148,10 @@ void AP_Param::convert_old_parameter(const struct ConversionInfo *info) } } else { // can't do vector<->scalar conversion, or different vector types -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat" hal.console->printf_P(PSTR("Bad conversion type '%S'\n"), info->new_name); -#pragma GCC diagnostic pop } } +#pragma GCC diagnostic pop // convert old vehicle parameters to new object parametersv