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

Build error because of empty initializers #2739

Closed
eschnett opened this issue Dec 19, 2023 · 2 comments
Closed

Build error because of empty initializers #2739

eschnett opened this issue Dec 19, 2023 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@eschnett
Copy link

I am building notcurses 3.0.9. I see this build error on Windows when building with GCC 7:

/workspace/srcdir/notcurses/src/demo/animate.c: In function ‘spin_cycle’:
--
  | [21:04:40] /workspace/srcdir/notcurses/src/demo/animate.c:134:19: error: empty scalar initializer
  | [21:04:40]   134 \|   mbstate_t mbs = { };
  | [21:04:40]       \|                   ^
  | [21:04:40] /workspace/srcdir/notcurses/src/demo/animate.c:134:19: note: (near initialization for ‘mbs’)
  | [21:04:40]

I believe the C 11 standard does not allow initializing variables via {}, i.e. via empty initializer lists.

The same problem might exist further down in the same file in line 271 ncprogbar_options popts = { };.

@eschnett eschnett added the bug Something isn't working label Dec 19, 2023
@dankamongmen dankamongmen self-assigned this Dec 20, 2023
@dankamongmen dankamongmen added this to the 3.1.0 milestone Dec 20, 2023
@dankamongmen
Copy link
Owner

yeah, we ought be using the = { 0 } form, good call

@dankamongmen
Copy link
Owner

should be resolved. thanks!

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
Development

No branches or pull requests

2 participants