mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-10-23 08:07:32 -06:00
[GH-ISSUE #526] Compiler warning assigning to char * from const char * #523
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#523
Loading…
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 @billdenney on GitHub (Aug 7, 2026).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/526
Originally assigned to: @jmcnamara on GitHub.
Related to ropensci/writexl#148
With GCC 16 (default
-std=gnu23) and glibc 2.43, the C23<string.h>search functions are const-correct:
strstr()/strpbrk()on aconst char *returnconst char *. Four assignments insrc/worksheet.c(current
main) then discard the qualifier:_check_table_name():ptr = strpbrk(name, ...)wherenameisconst char *butptrischar *—ptris only read, so it can beconst char *.worksheet_write_url_opt():found_string = strstr(url, "internal:"),"external:", and"mailto:"whereurlisconst char *— the resultis only null-tested, so
if (strstr(url, ...))avoids the assignment(
found_stringmust staychar *for the later writable use onurl_copy).CRAN's r-devel Fedora checks treat these as significant warnings, which
affects packages bundling libxlsxwriter (e.g. R's writexl). A patch is applied to writexl's vendored copy in ropensci/writexl#149.
@jmcnamara commented on GitHub (Aug 7, 2026):
Thanks. I'll look at it.