Skip to content

Remove c_sizeof and fix bugs that surfaced #1333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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