| 15 Mar 2026 |
emily | eh I guess I'm just repeating | 06:19:07 |
dramforever | for now, but maybe there will be more breakages | 06:19:09 |
dramforever | yeah i think we agree now | 06:19:29 |
emily | it would be nice for chromium to not be doing wrong things though | 06:19:52 |
dramforever | without relying on gnu extensions it gets ugly | 06:21:20 |
dramforever | don't know if they want to | 06:21:31 |
dramforever | * don't know if they want to just use char name[]; in c++ | 06:21:51 |
dramforever | if i worked faster i could have made that pr #500000 | 06:24:50 |
Vladimír Čunát | I honestly don't get why length of char array should affect alignment. (though I only have significant experience with pure C) | 06:28:19 |
dramforever | i think it's less alignment and more padding up the size of the struct? | 06:28:41 |
Vladimír Čunát | Yes, that's what I mean. | 06:28:55 |
dramforever | which, to be clear, is a weird thing to do for a struct with flexible array struct | 06:29:02 |
Vladimír Čunát | It's a char array, and chars have alignment of 1 only. | 06:29:11 |
dramforever | but if you just change it to name[] it trips a static assert somewhere else | 06:29:19 |
Vladimír Čunát | You'd do uint64_t name[1]; to get an aligned piece. | 06:30:32 |
Vladimír Čunát | (but that has aliasing issues) | 06:30:52 |
Vladimír Čunát | * (but that has aliasing issues in some usage patterns) | 06:31:10 |
dramforever | uint64_t nothing[0]; char name[]? | 06:31:18 |
Vladimír Čunát | * (but that has type-aliasing issues in some usage patterns) | 06:31:20 |
dramforever | or is that not allowed | 06:31:26 |
emily | given the UNSAFE_TODO I'm guessing this is some neglected corner of the browser | 06:31:33 |
emily | [0] is precisely GNU extension right | 06:31:42 |
Vladimír Čunát | Not in standard C | 06:31:43 |
dramforever | dang | 06:31:49 |
emily | isn't there an __attribute__((align(…))) or something. maybe something like that got standardized | 06:32:10 |
Vladimír Čunát | Yes. | 06:32:24 |
dramforever | oh, lol yeah | 06:32:32 |
dramforever | https://en.cppreference.com/w/c/language/alignas.html | 06:32:43 |
dramforever | although still | 06:32:55 |
dramforever | i'm not sure if that's what they even wanted | 06:33:04 |