Does the gcc of the ESP-IDF store different storage classes in different address spaces?
Here are the relevant code fragments:
Code: Select all
static const char *name_primitive = "Primitive";
static const char *name_date = "Date";
static const char *name_time = "Time";
static const char *name_sensor_value = "SensorValue";
static const char *name_rssi = "RSSI";
static const struct {
field_type_t type;
const char *name;
} field_type[] = {
{ FIELD_TYPE_PRIMITIVE, name_primitive },
{ FIELD_TYPE_TIME, name_time },
{ FIELD_TYPE_DATE, name_date },
{ FIELD_TYPE_SENSOR_VALUE, name_sensor_value },
{ FIELD_TYPE_WIFI_RSSI, name_rssi },
{ FIELD_TYPE_UNKNOWN, NULL }
};
Code: Select all
settings.c:88:29: error: initializer element is not constant
{ FIELD_TYPE_PRIMITIVE, name_primitive },
^~~~~~~~~~~~~~
settings.c:88:29: note: (near initialization for 'field_type[0].name')
settings.c:88:5: warning: missing initializer for field 'name' of 'const struct <anonymous>' [-Wmissing-field-initializers]
{ FIELD_TYPE_PRIMITIVE, name_primitive },
^
settings.c:86:21: note: 'name' declared here
const char *name;
^~~~
Can somebody help me to solve this problem?
Thanks in advance,
Michael