#include <stdint.h>
int main() {
uint8_t *p = (uint8_t[4]){"\252\273\314\335"};
}
❯ clang test.c -Wunterminated-string-initialization
test.c:3:31: warning: initializer-string for character array is too long, array size is 4 but initializer has size 5
(including the null terminating character); did you mean to use the 'nonstring' attribute? [-Wunterminated-string-initialization]
3 | uint8_t *p = (uint8_t[4]){"\252\273\314\335"};
| ^~~~~~~~~~~~~~~~~~
1 warning generated.
We've already made Zig's C backend use __attribute__((nonstring)) where possible, but in cases like this, it doesn't seem like there's anything we can do?
cc @AaronBallman (#137829)