3 ms·
Improvements to static analysis in the GCC 13 compiler
- thesnide 3y agoI'm wondering if the analysis that is done will feed some insights ro the optimizer. Or is it done in reverse, the optimizer that feeds data to the analysis?
- angry_octet 3y agoIn the first example it says the error is failing to allocate space for the null byte: struct str { size_t len; char data[]; }; struct str *str = malloc(sizeof(str) + len); But is this an idiom for doing Pascal style strings? That sizeof(char buf[]) returns 0 is interesting, perhaps only in a struct? A case where it isn't equivalent to char *. And now I'm wondering what sizeof would return for: struct str { size_t len; char data[]; char nullbyte; }; Presumably str.data would be the same value as &str.nullbyte?