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
This commit is contained in:
DrZiplok@gmail.com 2010-11-25 02:59:30 +00:00
parent aa2bbe9131
commit a468abcdbf

View File

@ -12,6 +12,12 @@
#include "include/menu.h" #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 // statics
char Menu::_inbuf[MENU_COMMANDLINE_MAX]; char Menu::_inbuf[MENU_COMMANDLINE_MAX];
Menu::arg Menu::_argv[MENU_ARGS_MAX + 1]; Menu::arg Menu::_argv[MENU_ARGS_MAX + 1];