This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: gcc warning when compiling Modules/expat/xmltok_ns.c
Type: compile error Stage: patch review
Components: Versions: Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Cyril Jouve, sping, vamsi1281977
Priority: normal Keywords: patch

Created on 2021-11-04 13:38 by vamsi1281977, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 31022 Cyril Jouve, 2022-02-08 20:14
Messages (2)
msg405717 - (view) Author: vamsi kalapala (vamsi1281977) Date: 2021-11-04 13:38
The code that triggers the compiler warning is:

NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end) {
#  define ENCODING_MAX 128
  char buf[ENCODING_MAX];  /// <==== THIS GIVES A WARNING.
  // THE FIX IS ====> char buf[ENCODING_MAX] = "";
  char *p = buf;
  int i;
  XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
  if (ptr != end)
    return 0;
  *p = 0;
  if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2)
    return enc;
  i = getEncodingIndex(buf);
  if (i == UNKNOWN_ENC)
    return 0;
  return NS(encodings)[i];
}
msg410702 - (view) Author: (sping) * Date: 2022-01-16 16:47
This has been fixed upstream in pull request https://github.com/libexpat/libexpat/pull/527 that is included with latest release libexpat 2.4.3.  bpo-46400 will fix this as a side effect.
History
Date User Action Args
2022-04-11 14:59:52adminsetgithub: 89876
2022-02-08 20:14:07Cyril Jouvesetkeywords: + patch
nosy: + Cyril Jouve

pull_requests: + pull_request29393
stage: patch review
2022-01-16 16:47:20spingsetnosy: + sping
messages: + msg410702
2021-11-04 13:38:37vamsi1281977create