Skip to content
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

00148.c array in structure #376

Closed
IngeniariusSoftware opened this issue Sep 10, 2022 · 1 comment · Fixed by #416
Closed

00148.c array in structure #376

IngeniariusSoftware opened this issue Sep 10, 2022 · 1 comment · Fixed by #416
Assignees
Labels
bug Something isn't working

Comments

@IngeniariusSoftware
Copy link
Member

remove the test from the line if it fixed in the testcuite:
00091, 00148: TODO array in structure

the test:
https://github.com/c-testsuite/c-testsuite/blob/master/tests/single-exec/00148.c

struct S {int a; int b;};
struct S arr[2] = {[1] = {3, 4}, [0] = {1, 2}};

int
main()
{
	if(arr[0].a != 1)
		return 1;
	if(arr[0].b != 2)
		return 2;
	if(arr[1].a != 3)
		return 3;
	if(arr[1].b != 4)
		return 4;
	return 0;
}
@IngeniariusSoftware IngeniariusSoftware added the bug Something isn't working label Sep 10, 2022
@LeDron12 LeDron12 linked a pull request Sep 14, 2022 that will close this issue
@LeDron12
Copy link
Contributor

LeDron12 commented Oct 2, 2022

Неверно считается размер структуры при инициализации, обращение к элементам поправил

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants