[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/XS/parsetexi/api.c (parse_file): cas
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/XS/parsetexi/api.c (parse_file): cast the decode_string argument to char* to remove the const, as, even if decode_string do not modify its argument, it cannot be marked const if iconv input buffer is not const in iconv prototype. |
Date: |
Wed, 29 May 2024 07:32:12 -0400 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new 3e48a69137 * tp/Texinfo/XS/parsetexi/api.c (parse_file): cast the
decode_string argument to char* to remove the const, as, even if decode_string
do not modify its argument, it cannot be marked const if iconv input buffer is
not const in iconv prototype.
3e48a69137 is described below
commit 3e48a691373439847b5e58afb2ef88acce6b4365
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed May 29 13:31:59 2024 +0200
* tp/Texinfo/XS/parsetexi/api.c (parse_file): cast the decode_string
argument to char* to remove the const, as, even if decode_string do
not modify its argument, it cannot be marked const if iconv input
buffer is not const in iconv prototype.
---
ChangeLog | 7 +++++++
tp/Texinfo/XS/main/utils.c | 3 +++
tp/Texinfo/XS/parsetexi/api.c | 4 +++-
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 5fa7246b52..6cce0459af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-05-29 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/parsetexi/api.c (parse_file): cast the decode_string
+ argument to char* to remove the const, as, even if decode_string do
+ not modify its argument, it cannot be marked const if iconv input
+ buffer is not const in iconv prototype.
+
2024-05-29 Patrice Dumas <pertusus@free.fr>
Use the command line encoding for input file name in message
diff --git a/tp/Texinfo/XS/main/utils.c b/tp/Texinfo/XS/main/utils.c
index 1df76e737c..6d209b699c 100644
--- a/tp/Texinfo/XS/main/utils.c
+++ b/tp/Texinfo/XS/main/utils.c
@@ -493,6 +493,9 @@ encode_with_iconv (iconv_t our_iconv, char *s,
return strdup (t.text);
}
+/* NOTE INPUT_STRING should not be modified by iconv, but it cannot be marked
+ as const if the iconv call does not have a const in prototype */
+/* Return value to be freed by the caller */
char *
decode_string (char *input_string, const char *encoding, int *status,
const SOURCE_INFO *source_info)
diff --git a/tp/Texinfo/XS/parsetexi/api.c b/tp/Texinfo/XS/parsetexi/api.c
index 491fc28783..a729890a05 100644
--- a/tp/Texinfo/XS/parsetexi/api.c
+++ b/tp/Texinfo/XS/parsetexi/api.c
@@ -176,8 +176,10 @@ parse_file (const char *input_file_path, int *status)
if (global_parser_conf.command_line_encoding)
{
int status;
+ /* cast as decode_string argument should not be modified but cannot
be
+ marked as const */
decoded_file_path
- = decode_string (input_file_path,
+ = decode_string ((char *)input_file_path,
global_parser_conf.command_line_encoding,
&status, 0);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/XS/parsetexi/api.c (parse_file): cast the decode_string argument to char* to remove the const, as, even if decode_string do not modify its argument, it cannot be marked const if iconv input buffer is not const in iconv prototype.,
Patrice Dumas <=