std.cfg: Added not-overlapping-data configuration to wmemcpy()
This commit is contained in:
parent
140aa6afb4
commit
3e7b6f262d
|
@ -3884,6 +3884,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
|
|||
<returnValue type="wchar_t *"/>
|
||||
<noreturn>false</noreturn>
|
||||
<leak-ignore/>
|
||||
<not-overlapping-data ptr1-arg="1" ptr2-arg="2" size-arg="3"/>
|
||||
<arg nr="1" direction="out">
|
||||
<not-null/>
|
||||
<minsize type="argvalue" arg="3"/>
|
||||
|
|
|
@ -9342,6 +9342,25 @@ private:
|
|||
" memcpy(a, a+1, 2u);\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("[test.cpp:3]: (error) Overlapping read/write in memcpy() is undefined behavior\n", errout.str());
|
||||
|
||||
// wmemcpy
|
||||
check("void foo() {\n"
|
||||
" wchar_t a[10];\n"
|
||||
" wmemcpy(&a[5], &a[4], 2u);\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("[test.cpp:3]: (error) Overlapping read/write in wmemcpy() is undefined behavior\n", errout.str());
|
||||
|
||||
check("void foo() {\n"
|
||||
" wchar_t a[10];\n"
|
||||
" wmemcpy(a+5, a+4, 2u);\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("[test.cpp:3]: (error) Overlapping read/write in wmemcpy() is undefined behavior\n", errout.str());
|
||||
|
||||
check("void foo() {\n"
|
||||
" wchar_t a[10];\n"
|
||||
" wmemcpy(a, a+1, 2u);\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("[test.cpp:3]: (error) Overlapping read/write in wmemcpy() is undefined behavior\n", errout.str());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue