Skip to content

Commit 674a8f0

Browse files
committed
Visual Studio rejects pointer arithmetic and dereferencing of void*
Pointer arithmetic using void* is a (document) GCC extension. Dereferencing void* pointers is permitted by GCC when the value is unused. Visual Studio rejects both. This required updates to tests to either not rely on pointer arithmetic over void*, or restrict tests to GCC only. Fixes: #5275
1 parent 12ef9e7 commit 674a8f0

File tree

17 files changed

+64
-15
lines changed

17 files changed

+64
-15
lines changed

regression/ansi-c/sizeof5/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE gcc-only
22
main.c
33

44
^EXIT=0$

regression/cbmc-cpp/Function_Arguments1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE gcc-only
22
main.cpp
33

44
^EXIT=0$

regression/cbmc/null6/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
void *guard_malloc_counter = 0;
1+
char *guard_malloc_counter = 0;
22

33
void *my_malloc(int size)
44
{

regression/cbmc/ptr_arithmetic_on_null/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE gcc-only
22
main.c
33

44
^\[main.assertion.1\] line .* assertion \(void \*\)0 != \(void \*\)0 \+ \(.*\)1: SUCCESS$

regression/cbmc/void_pointer1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE gcc-only
22
main.c
33
--pointer-check
44
^EXIT=0$

regression/cbmc/void_pointer2/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE gcc-only
22
main.c
33
--pointer-check --no-simplify --unwind 3
44
^EXIT=0$

regression/cbmc/void_pointer3/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE broken-smt-backend
1+
CORE broken-smt-backend gcc-only
22
main.c
33

44
^EXIT=0$

regression/cbmc/void_pointer5/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE broken-smt-backend
1+
CORE broken-smt-backend gcc-only
22
main.c
33

44
^EXIT=10$

regression/cbmc/void_pointer6/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE gcc-only
22
main.c
33
--pointer-check
44
^EXIT=10$

regression/cbmc/void_pointer7/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE gcc-only
22
main.c
33
--pointer-check
44
^EXIT=0$

0 commit comments

Comments
 (0)