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

misdiagnosis of scalar initializer for flexible array #3990

Closed
llvmbot opened this issue Feb 19, 2009 · 3 comments
Closed

misdiagnosis of scalar initializer for flexible array #3990

llvmbot opened this issue Feb 19, 2009 · 3 comments
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Feb 19, 2009

Bugzilla Link 3618
Resolution FIXED
Resolved on Mar 12, 2010 00:57
Version unspecified
OS All
Reporter LLVM Bugzilla Contributor
CC @DougGregor

Extended Description

--
ddunbar@milton:min$ cat /tmp/t.c
struct { int x; int y[]; } a = { 1, 2 };
ddunbar@milton:min$ ccc -fsyntax-only /tmp/t.c
/tmp/t.c:1:37: warning: excess elements in struct initializer
struct { int x; int y[]; } a = { 1, 2 };
^
1 diagnostic generated.

gcc treats "2" as a single initializer for the flexible array, I don't think we need that level of compatibility but we should at least error on this (vs miscompiling).

@DougGregor
Copy link
Contributor

I think it's reasonable to warn and then drop the initializer. I'll look into it.

@DougGregor
Copy link
Contributor

Hmph, no, that's not reasonable. We'll warn and then do what GCC does; I'll handle this one.

@DougGregor
Copy link
Contributor

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
plotfi pushed a commit to plotfi/llvm-project that referenced this issue Mar 15, 2022
[VFS] Add a "redirecting-with" field to overlays
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
Development

No branches or pull requests

2 participants