Question
Hello, Daniel, function:
void parser_datatype_adjust_size_for_secondary(struct datatype* datatype, struct token* datatype_secondary_token)
{
if(!datatype_secondary_token)
return;
struct datatype* secondary_data_type = calloc(1, sizeof(struct datatype));
parser_datatype_init_type_and_size_for_primitive(datatype_secondary_token, NULL, secondary_data_type);
datatype->size += secondary_data_type->size;
datatype->datatype_secondary = secondary_data_type;
datatype->flags |= DATATYPE_FLAG_IS_SECONDARY;
}
when I declared a variable like this:
short int a;
the result of datatype->size will be 6( 2 + 4), Is it correct? I am a little bit confused, My be I don't understand secondary data type well, can you give me an example?