https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106939
--- Comment #8 from Arseny Vakhrushev ---
Thank you, Jakub! I have read that section and can see that the Standard is
just very cautious about the cases it doesn't cover labeling them as "undefined
behaviour". The most likely reason is memory se
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106939
--- Comment #6 from Arseny Vakhrushev ---
Lots of thanks again, Andrew!
--
#include
#include
extern char _dst[], _src[], _end[];
int main(void) {
memcpy(_dst, _src, _end - _src);
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106939
--- Comment #4 from Arseny Vakhrushev ---
Thanks a lot, Andrew! Totally my bad. Well, comparison seems to work too:
extern char _src[], _dst[], _end[]; // Defined by the linker
int main(void) {
char *src = &_src[0];
char *dst = &_dst[0]
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106939
--- Comment #2 from Arseny Vakhrushev ---
Thanks for the quick reply! I've read the aforementioned comments, but can't
get to see any similarities. May I ask you to recap what needs to be done in
plain and simple words or direct me to the corre
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106939
Bug ID: 106939
Summary: Linker-defined symbols are stained due to 'array
subscript is partly outside array bounds' warning
Product: gcc
Version: 12.2.0
Status: UNCONFIRM