fontconfig: mark _FcPatternIter as may_alias

We had a report of GCC 14 with -O3 -flto causing wrong font
sizes with fontconfig (showing up in qalculate-gtk).

It turns out to be because _FcPatternIter and _FcPatternPrivateIter
are punned between which violates strict-aliasing rules, which
manifested in FcDefaultSubstitute getting a bogus value from
FcValueCanonicalize for size.

void* isn't allowed to alias anything -- you can pass addresses
around provided you cast back to the original type, but if you
access through the wrong type, you've violated aliasing rules.

Bug: https://bugs.gentoo.org/940923
Signed-off-by: Sam James <sam@gentoo.org>
1 file changed
tree: 0cd4954e87535c784b7ee3af64e280c774a56286
  1. .gitlab-ci/
  2. conf.d/
  3. doc/
  4. fc-cache/
  5. fc-case/
  6. fc-cat/
  7. fc-conflist/
  8. fc-lang/
  9. fc-list/
  10. fc-match/
  11. fc-pattern/
  12. fc-query/
  13. fc-scan/
  14. fc-validate/
  15. fontconfig/
  16. its/
  17. m4/
  18. meson-cc-tests/
  19. po/
  20. po-conf/
  21. src/
  22. subprojects/
  23. test/
  24. .gitlab-ci.yml
  25. AUTHORS
  26. autogen.sh
  27. config-fixups.h
  28. configure.ac
  29. COPYING
  30. fontconfig-zip.in
  31. fontconfig.pc.in
  32. fonts.conf.in
  33. fonts.dtd
  34. git.mk
  35. INSTALL
  36. local.conf
  37. Makefile.am
  38. meson.build
  39. meson_options.txt
  40. new-version.sh
  41. NEWS
  42. README.md
  43. Tools.mk
README.md

Fontconfig

Font configuration and customization library

[[TOC]]

About Fontconfig

Fontconfig can:

  • discover new fonts when installed automatically, removing a common source of configuration problems.
  • perform font name substitution, so that appropriate alternative fonts can be selected if fonts are missing.
  • identify the set of fonts required to completely cover a set of languages.
  • have GUI configuration tools built as it uses an XML-based configuration file (though with autodiscovery, we believe this need is minimized).
  • efficiently and quickly find the fonts you need among the set of fonts you have installed, even if you have installed thousands of fonts, while minimizing memory usage.
  • be used in concert with the X Render Extension and FreeType to implement high quality, anti-aliased and subpixel rendered text on a display.

Fontconfig does not:

  • render the fonts themselves (this is left to FreeType or other rendering mechanisms)
  • depend on the X Window System in any fashion, so that printer only applications do not have such dependencies

Documentation

Bug reports

If you have encountered any issues relating to Fontconfig, please file an issue in the GitLab issue tracker.