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
Until C23, if new_size is zero, the behavior is implementation defined (null pointer may be returned (in which case the old memory block may or may not be freed), or some non-null pointer may be returned that may not be used to access storage). Such usage is deprecated (via C DR 400).(since C17)
Since C23, if new_size is zero, the behavior is undefined.
The conservative thing to do is to only catch new_size=0 when compiling with C23, but I'm wondering if we should always return NULL otherwise.
The text was updated successfully, but these errors were encountered:
Until C23, if
new_size
is zero, the behavior is implementation defined (null pointer may be returned (in which case the old memory block may or may not be freed), or some non-null pointer may be returned that may not be used to access storage). Such usage is deprecated (via C DR 400).(since C17)Since C23, if
new_size
is zero, the behavior is undefined.The conservative thing to do is to only catch
new_size=0
when compiling with C23, but I'm wondering if we should always returnNULL
otherwise.The text was updated successfully, but these errors were encountered: