dankamongmen / notcurses

blingful character graphics/TUI library. definitely not curses.
https://nick-black.com/dankwiki/index.php/Notcurses
Other
3.4k stars 113 forks source link

Build error because of empty initializers #2739

Closed eschnett closed 6 months ago

eschnett commented 6 months ago

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 = { };.

dankamongmen commented 6 months ago

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

dankamongmen commented 6 months ago

should be resolved. thanks!