From 9ab598e2b2c5647a9d0d043f1f1c2c6d6ab2fb8b Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Fri, 27 Jun 2025 14:41:14 +0100 Subject: [PATCH] .github: add comments explaning the reasons behind xts patching Signed-off-by: Mike Gelfand --- .github/scripts/util.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/scripts/util.sh b/.github/scripts/util.sh index 29e87ff3d..cd74de195 100644 --- a/.github/scripts/util.sh +++ b/.github/scripts/util.sh @@ -84,9 +84,20 @@ build_ac_xts() { cd $pkgname CFLAGS='-fcommon' if [ "$X11_OS" = "Darwin" ]; then + # xts5/include/XtTest.h includes => needs xt + # xts5/src/libXtaw/*.c include and => need xmu and xaw7 sed -E -i~ 's|(\[XTS\], \[)|\1xt xmu xaw7 |' configure.ac + # xts5/Xlib14/X{mb,wc}TextListToTextProperty.m define a function accepting `XTextProperty` but call it passing + #`XTextProperty*`; since the parameter is seemingly meant for output, accept it as pointer sed -E -i~ -e 's|(XTextProperty)[[:space:]]+(text_prop_good)|\1 *\2|' -e 's|(style_good),[[:space:]]*&(text_prop_good)|\1,\2|' -e 's|text_prop_good\.|text_prop_good->|' xts5/Xlib14/X{mb,wc}TextListToTextProperty.m + # xts5/Xlib*/*.m forward-declare `strcpy()` which is incompatible with _FORTIFY_SOURCE > 0 where `strcpy` is + # a macro; set _FORTIFY_SOURCE to 0 as we don't care much about security in this test code CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0" + # declarations for `XtAppSetError{,Msg}Handler()` in (libXt) make it hard to write warning- + # free code: they want a noreturn-annotated handler as input but return old handler without noreturn annotation, + # so e.g. `XtAppSetErrorHandler(XtAppSetErrorHandler(NULL))` (similar to xts5/Xt13/XtAppSetError*Handler.m) + # doesn't compile complaining about incompatible function pointers, at least with Apple Clang 16 (not sure why + # it treats this warning as error by default though) if cc -Werror=unknown-warning-option -Wincompatible-function-pointer-types -c -xc -o /dev/null /dev/null 2>/dev/null; then CFLAGS="$CFLAGS -Wno-error=incompatible-function-pointer-types" fi