Skip to content

Commit

Permalink
Merge pull request #1333 from tautschnig/remove-c_sizeof
Browse files Browse the repository at this point in the history
Remove c_sizeof and fix bugs that surfaced
  • Loading branch information
tautschnig authored Sep 8, 2017
2 parents 1c8d81a + 3613ebc commit 5863a75
Show file tree
Hide file tree
Showing 16 changed files with 149 additions and 439 deletions.
6 changes: 6 additions & 0 deletions regression/ansi-c/Initializer_cast2/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
int main()
{
int A[(sizeof((int[]){1, 2, 3})==3*sizeof(int))?1:-1];

return 0;
}
7 changes: 7 additions & 0 deletions regression/ansi-c/Initializer_cast2/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CORE
main.c

^EXIT=0$
^SIGNAL=0$
--
^CONVERSION ERROR$
13 changes: 13 additions & 0 deletions regression/ansi-c/array_initialization3/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#define STATIC_ASSERT_sizeof(condition) \
int[(condition) ? 1 : -1]

int A[];
int B[];

int A[1]={sizeof(A)};
int B[1]={sizeof(STATIC_ASSERT_sizeof(sizeof(B)==sizeof(int)))};

int main()
{
return 0;
}
8 changes: 8 additions & 0 deletions regression/ansi-c/array_initialization3/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
main.c

^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
^CONVERSION ERROR$
15 changes: 15 additions & 0 deletions regression/ansi-c/sizeof5/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#define STATIC_ASSERT(condition) \
int some_array##__LINE__[(condition) ? 1 : -1];

struct S
{
int x;
};

int main()
{
struct S s;
__typeof__(*((void *)&s.x)) *_s=&s.x;
STATIC_ASSERT(sizeof(*_s)==1);
return 0;
}
8 changes: 8 additions & 0 deletions regression/ansi-c/sizeof5/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
main.c

^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
^CONVERSION ERROR$
1 change: 0 additions & 1 deletion src/ansi-c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ SRC = anonymous_member.cpp \
c_nondet_symbol_factory.cpp \
c_preprocess.cpp \
c_qualifiers.cpp \
c_sizeof.cpp \
c_storage_spec.cpp \
c_typecast.cpp \
c_typecheck_argc_argv.cpp \
Expand Down
320 changes: 0 additions & 320 deletions src/ansi-c/c_sizeof.cpp

This file was deleted.

Loading

0 comments on commit 5863a75

Please sign in to comment.