You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is detected with clang and -fsanitizer=bounds.
Out-of-bound addressing array of fixed size is undefined
behavior in both C and C++. It is so even if underlying
memory is properly allocated. To avoid undefined behavior
in cases like this C99 added feature called "flexible array member"
when size of array is omitted.
Unfortunately it's not C++ feature. However both clang++ and
g++ this and this seems the only reasonable way
to avoid undefined behavior without significant rewriting such code.
0 commit comments