From a468abcdbf83937a25c795c904ff1b33badf99f9 Mon Sep 17 00:00:00 2001 From: "DrZiplok@gmail.com" Date: Thu, 25 Nov 2010 02:59:30 +0000 Subject: [PATCH] Add a better workaround for a GCC bug that generates spurious warnings for PSTR() git-svn-id: https://arducopter.googlecode.com/svn/trunk@920 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- libraries/AP_Common/menu.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/AP_Common/menu.cpp b/libraries/AP_Common/menu.cpp index c77aab036c..e58f5c444a 100644 --- a/libraries/AP_Common/menu.cpp +++ b/libraries/AP_Common/menu.cpp @@ -12,6 +12,12 @@ #include "include/menu.h" +// workaround for GCC bug c++/34734 +#undef PROGMEM +#define PROGMEM __attribute__(( section(".progmem.data") )) +#undef PSTR +#define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); &__c[0];})) + // statics char Menu::_inbuf[MENU_COMMANDLINE_MAX]; Menu::arg Menu::_argv[MENU_ARGS_MAX + 1];