If building Okular on a Musl based system (like Alpine Linux or postmarketOS), compilation will fail: okular-18.08.1/core/synctex/synctex_parser.c:8202:13: error: implicit declaration of function 'vasprintf' [-Werror=implicit-function-declaration] if (vasprintf(&buffer, format, va) < 0) { ^~~~~~~~~ This is due to the use of "vasprintf()" which is not part of POSIX (https://linux.die.net/man/3/vasprintf). It can be quite easily resolved by using "vsprintf()" instead, but I'm guessing this will cause problems during runtime due to missing the terminating null byte.
Those files are "copied" from syntex, you should open an issue at https://github.com/jlaurens/synctex/issues since that way we can import fixes from them. Also given that musl is kind of not easy to come by i guess it'd be great if you could provide a patch. It should not be very hard since there seems to be already an own implementation of vasprintf https://github.com/jlaurens/synctex/blob/2017/synctex_parser.c#L8409 Please if you open a bug on their side please link it here so we can also keep track of it.
This bug is still present in Okular 23.08.5. The error was fixed upstream in https://github.com/jlaurens/synctex/pull/39 but reappeared, because the fix was only applied to one branch. I filed a new upstream bug here: https://github.com/jlaurens/synctex/issues/80 There are two related pull requests currently open: https://invent.kde.org/graphics/okular/-/merge_requests/722 https://invent.kde.org/graphics/okular/-/merge_requests/723
> The error was fixed upstream in https://github.com/jlaurens/synctex/pull/39 > but reappeared, because the fix was only applied to one branch. It was actually applied to all branches except for one, which was the one I checked. An import of the changes from either the `2024` stable branch or the `main` development one should fix the issue.