I'm getting this warning:
warning: initializer element is not constant [-Wpedantic]
7 | (struct Point){.is_source = true, .is_target = true},
note: (near initialization for ‘interval_1[0]’)
This is my code
#include <stdbool.h>
struct Point {
bool is_target;
bool is_source;
};
static struct Point interval_1[] = {
(struct Point){.is_source = true, .is_target = true},
(struct Point){.is_source = false, .is_target = false},
};
int main(){
// whatever...
}
This is very confusing, How can I fix this? Note that this is an extremely simplified version of my code. interval_1 js meant to be a testcase for my unit tests.
I tried playing around with constants and macros but I can't figure it out.