summaryrefslogtreecommitdiff
path: root/api_test/cplusplus.cpp
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-05-13 17:07:29 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2020-05-13 17:07:29 -0700
commit53abb8e3ab21a31ca7b4921207bd97bb42355c80 (patch)
tree4100fe6e4e0b1aa943e7e947457e590eb5940430 /api_test/cplusplus.cpp
parent3bfdadcb66aa969bee2eefe6da5df5028b55849d (diff)
Don't call memcpy with NULL as 1st parameter.
This is illegal according to the C standard, sec. 7.1.4. "If an argument to a function has an invalid value (such as a value outside the domain of the function, or a pointer outside the address space of the program, or a null pointer, or a pointer to non-modifiable storage when the corresponding parameter is not const-qualified) or a type (after promotion) not expected by a function with variable number of arguments, the behavior is undefined." 7.24.1(2): "Where an argument declared as size_t n specifies the length of the array for a function, n can have the value zero […] pointer arguments on such a call shall still have valid values, as described in 7.1.4." See https://www.imperialviolet.org/2016/06/26/nonnull.html
Diffstat (limited to 'api_test/cplusplus.cpp')
0 files changed, 0 insertions, 0 deletions