Summary: | x11-libs/pango-1.50.14 fails with GCC 13 (13.0.1_pre20230326) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Adrien Dessemond <admnd> |
Component: | Current packages | Assignee: | Gentoo Linux Gnome Desktop Team <gnome> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | arsen |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://gitlab.gnome.org/GNOME/pango/-/issues/740 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 865117 |
Description
Adrien Dessemond
2023-03-28 02:01:02 UTC
1.50.14 is the latest release so far, so I am out of luck :) An ugly workaround (to avoid some code refactoring hell) would be to put some "#pragma GCC diagnostic" directives around the function find_best_lang_match_cached() like this: (...) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warray-bounds" static gconstpointer find_best_lang_match_cached (PangoLanguage *language, gconstpointer *cache, gconstpointer records, guint num_records, guint record_size) { gconstpointer result; if (G_LIKELY (cache && *cache != (gconstpointer) -1)) return *cache; result = find_best_lang_match (language, records, num_records, record_size); if (cache) *cache = result; return result; } #pragma GCC diagnostic pop (...) This function is used via a #define at only two places in the very same file: see functions pango_language_get_sample_string() and pango_language_get_scripts() At both places, what find_best_lang_match_cached() returns is checked for a NULL value so I am quite confident that this trick will not break Pango. (Not reported at upstream yet). Please pop a link here when you do report upstream to Pango. Also a chance, as ever, that it's an FP, but it could easily be the compiler is better at analysis. Fun as always & thank you for testing gcc 13! Reported upstream, see the link in "See also". can't reproduce on a checkout of 1.50.14 with /tmp/pango$ gcc --version gcc (Gentoo Hardened 13.0.1_pre20230409-r4 p9) 13.0.1 20230409 (experimental) Copyright (C) 2023 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. and CC=gcc CFLAGS="-O3 -pipe -march=native -fomit-frame-pointer -fopt-info-vec -fcf-protection=return -flto=auto" oddly enough, can reproduce under portage The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f688df5100ef2b88c975ecd40fd343c62e2ab276 commit f688df5100ef2b88c975ecd40fd343c62e2ab276 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-04-26 02:10:54 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-04-26 02:10:54 +0000 x11-libs/pango: workaround -Werror=array-bounds issue w/ GCC 13 Seems to be a false positive. Reported upstream by Adrien at https://gitlab.gnome.org/GNOME/pango/-/issues/740. Happens w/ GCC 13 combined with -O3 at least but may happen for other combinations too. Can't append -Wno-error=... because of the order the flags are added, unfortunately. Closes: https://bugs.gentoo.org/903259 Signed-off-by: Sam James <sam@gentoo.org> x11-libs/pango/pango-1.50.14.ebuild | 4 ++++ 1 file changed, 4 insertions(+) |