Skip to content

Commit 5863a75

Browse files
authored
Merge pull request #1333 from tautschnig/remove-c_sizeof
Remove c_sizeof and fix bugs that surfaced
2 parents 1c8d81a + 3613ebc commit 5863a75

File tree

16 files changed

+149
-439
lines changed

16 files changed

+149
-439
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
int main()
2+
{
3+
int A[(sizeof((int[]){1, 2, 3})==3*sizeof(int))?1:-1];
4+
5+
return 0;
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^CONVERSION ERROR$
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#define STATIC_ASSERT_sizeof(condition) \
2+
int[(condition) ? 1 : -1]
3+
4+
int A[];
5+
int B[];
6+
7+
int A[1]={sizeof(A)};
8+
int B[1]={sizeof(STATIC_ASSERT_sizeof(sizeof(B)==sizeof(int)))};
9+
10+
int main()
11+
{
12+
return 0;
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
^CONVERSION ERROR$

regression/ansi-c/sizeof5/main.c

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#define STATIC_ASSERT(condition) \
2+
int some_array##__LINE__[(condition) ? 1 : -1];
3+
4+
struct S
5+
{
6+
int x;
7+
};
8+
9+
int main()
10+
{
11+
struct S s;
12+
__typeof__(*((void *)&s.x)) *_s=&s.x;
13+
STATIC_ASSERT(sizeof(*_s)==1);
14+
return 0;
15+
}

regression/ansi-c/sizeof5/test.desc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
^CONVERSION ERROR$

src/ansi-c/Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ SRC = anonymous_member.cpp \
1414
c_nondet_symbol_factory.cpp \
1515
c_preprocess.cpp \
1616
c_qualifiers.cpp \
17-
c_sizeof.cpp \
1817
c_storage_spec.cpp \
1918
c_typecast.cpp \
2019
c_typecheck_argc_argv.cpp \

src/ansi-c/c_sizeof.cpp

-320
This file was deleted.

0 commit comments

Comments
 (0)