[GH-ISSUE #60] Another MSVC++ 2010 issue with variable declaration in packager.c #50

Closed
opened 2026-05-05 11:31:49 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @utelle on GitHub (Jul 4, 2016).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/60

Originally assigned to: @jmcnamara on GitHub.

Since MSVC++ 2010 does not support the C99 standard, variable declaration have to be placed at the beginning of scope block. Therefore packager.c doesn't compile properly due to lines 58 and 59 declaring a variable after some executable code:

58:    /* Use the native Win32 file handling functions with minizip. */
59:    zlib_filefunc64_def filefunc;

This is allowed for C99, but not for C89. Moving these 2 lines a bit up, for example just below line 47

47: wchar_t wide_filename[_MAX_PATH + 1] = L"";

solves the problem.

Originally created by @utelle on GitHub (Jul 4, 2016). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/60 Originally assigned to: @jmcnamara on GitHub. Since MSVC++ 2010 does not support the C99 standard, variable declaration have to be placed at the beginning of scope block. Therefore `packager.c` doesn't compile properly due to lines 58 and 59 declaring a variable after some executable code: ``` 58: /* Use the native Win32 file handling functions with minizip. */ 59: zlib_filefunc64_def filefunc; ``` This is allowed for C99, but not for C89. Moving these 2 lines a bit up, for example just **below** line 47 ``` 47: wchar_t wide_filename[_MAX_PATH + 1] = L""; ``` solves the problem.
gitea-mirror 2026-05-05 11:31:49 -06:00
Author
Owner

@jmcnamara commented on GitHub (Jul 4, 2016):

Fixed on master.

<!-- gh-comment-id:230353614 --> @jmcnamara commented on GitHub (Jul 4, 2016): Fixed on master.
Author
Owner

@jmcnamara commented on GitHub (Jul 4, 2016):

Fixed in release 0.4.0. Thanks for the report.

<!-- gh-comment-id:230363775 --> @jmcnamara commented on GitHub (Jul 4, 2016): Fixed in release 0.4.0. Thanks for the report.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#50
No description provided.