mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #59] Inconsistant constness of char* parameters #51
Labels
No labels
awaiting user feedback
bug
cmake
cmake
docs
feature request
in progress
long term
medium term
medium term
pull-request
question
question
ready to close
short term
under investigation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/libxlsxwriter#51
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @utelle on GitHub (Jul 4, 2016).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/59
Originally assigned to: @jmcnamara on GitHub.
Many
libxlsxwriterfunctions take text strings as parameters. The constness of those string parameters is used inconsistently. While sometimesconst char*is used, several functions just usechar*.In my application I have string variables declared with
const char*. At least for MSVC++ 2010 passing such variables tolibxlsxwriterfunctions often result in the compiler messageAt the moment I have only inspected the functions defined for workbooks and worksheets. That is, the following list of affected functions might be incomplete. Here is a list of functions that use
char*parameters, but IMHO should useconst char*instead, because they don't manipulate the strings passed to them, but usually just create a copy usingstrdup:@jmcnamara commented on GitHub (Jul 4, 2016):
I seem to have started with const correctness and forgot it along the way.
The char* in the API should now all be const on master.
@utelle commented on GitHub (Jul 4, 2016):
Thanks for taking care of the issues I created today so quickly. Much appreciated.
@jmcnamara commented on GitHub (Jul 4, 2016):
Fixed in release 0.4.0. Thanks for the report.