main.cpp
Код
#include <avr/pgmspace.h>
#ifdef __cplusplus
#define extern "C"
#endif
typedef struct PROGMEM{
const int X;
const char Text[];
}Q;
int main(){
Q q1 = {0, "qqqq"}; // 13
Q q2 = {0, {0x00}}; // 14
return 0;
}
#ifdef __cplusplus
#define extern "C"
#endif
typedef struct PROGMEM{
const int X;
const char Text[];
}Q;
int main(){
Q q1 = {0, "qqqq"}; // 13
Q q2 = {0, {0x00}}; // 14
return 0;
}
Компилятр AVR-GCC, makefile студийный.
Ошибки ссылаются на строки объявления переменных q1 и q2:
Build started 17.12.2010 at 00:17:42
avr-g++ -mmcu=atmega128 -Wall -gdwarf-2 -Os -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT main.o -MF dep/main.o.d -c ../main.cpp
cc1plus.exe: warning: command line option "-std=gnu99" is valid for C/ObjC but not for C++
../main.cpp: In function 'int main()':
../main.cpp:13: error: initializer-string for array of chars is too long
../main.cpp:14: error: too many initializers for 'const char [0]'