[all-commits] [llvm/llvm-project] f9e2e8: [Clang] Use const pointer to eliminate warning wit...

FantasqueX via All-commits all-commits at lists.llvm.org
Sun Jan 21 01:34:41 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f9e2e85b07ee2c19bbef8fda50b3f664d6f5193e
      https://github.com/llvm/llvm-project/commit/f9e2e85b07ee2c19bbef8fda50b3f664d6f5193e
  Author: FantasqueX <fantasquex at gmail.com>
  Date:   2024-01-21 (Sun, 21 Jan 2024)

  Changed paths:
    M clang/tools/c-index-test/c-index-test.c

  Log Message:
  -----------
  [Clang] Use const pointer to eliminate warning with libxml 2.12.0 (#76719)

Currently, if `CLANG_HAVE_LIBXML` is defined, and the version of libxml2
is above 2.12.0, there will be two warnings when building clang.

warning: initializing 'xmlErrorPtr' (aka 'struct _xmlError *') with an
expression of type 'const xmlError *' (aka 'const struct _xmlError *')
discards qualifiers

Since this commit

https://gitlab.gnome.org/GNOME/libxml2/-/commit/45470611b047db78106dcb2fdbd4164163c15ab7,
libxml2 makes cmlGetLastError return a const error. This patch follows
libxml2. Making the result a const pointer should be compatible with
versions before 2.12.0.

Tested on ArchLinux with libxml2 2.12.3 installed.




More information about the All-commits mailing list