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

string initializer truncate #16

Open
huangguiyang opened this issue Nov 22, 2016 · 1 comment
Open

string initializer truncate #16

huangguiyang opened this issue Nov 22, 2016 · 1 comment
Labels

Comments

@huangguiyang
Copy link

struct S {
    char c[10];
};

struct S s = {"abc", .c[0] = 89};

gcc:

	.globl	s1
	.data
	.align 8
	.type	s1, @object
	.size	s1, 10
s1:
	.byte	89
	.byte	98
	.byte	99
	.byte	0
	.zero	6

wgtcc:

	.data
	.globl	s1
	.align	1
	.type	s1, @object
	.size	s1, 10
s1:
	.byte	89
	.zero	9
@wgtdkp
Copy link
Owner

wgtdkp commented Nov 22, 2016

是的,这是一个已知的bug,我的做法只是简单地让后面的initializer覆盖前面的
(用set维护初始化列表)。在测试用例里面,我应该注释了这个问题。

@wgtdkp wgtdkp added the wontfix label Jan 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants