linebreak: Avoid implicit declaration of u8_mbtouc_unsafe function#16
Open
fweimer-rh wants to merge 1 commit intotux4kids:masterfrom
Open
linebreak: Avoid implicit declaration of u8_mbtouc_unsafe function#16fweimer-rh wants to merge 1 commit intotux4kids:masterfrom
fweimer-rh wants to merge 1 commit intotux4kids:masterfrom
Conversation
GNULIB_UNISTR_U8_MBTOUC_UNSAFE tells the bundled unistr.h to provide a function prototype for u8_mbtouc_unsafe. This prevents build failures with future compilers which do not support implicit function declarations. Upstream gnulib has split the linebreak module into multiple parts; it is hard to tell if it still has the same issue.
|
@fweimer-rh Thanks for the patch. Along with this fix, I found we also need a little bit more fixing to be able to build with GCC 14 Bug: https://bugs.gentoo.org/923789
From: Brahmajit Das <brahmajit.xyz@gmail.com>
Date: Fri, 9 Feb 2024 11:49:53 +0530
Subject: [PATCH 2/2] t4k_menu: Fix passing incompatible pointer type
First observed under Gentoo Linux with GCC 14, probably due to
mismatching types between child (struct _xmlAttr *) and node.children
(struct _xmlAttr *).
Resulting in build errors such as
t4k_menu.c:254:23: error: assignment to 'xmlAttr *' {aka 'struct _xmlAttr *'} from incompatible pointer type 'struct _xmlNode *' [-Wincompatible-pointer-types]
254 | for(child = node->children; child; child = child->next) {
| ^
t4k_menu.c:256:62: error: passing argument 1 of 'menu_TranslateNode' from incompatible pointer type [-Wincompatible-pointer-types]
256 | tnode->submenu[i++] = menu_TranslateNode(child);
| ^~~~~
| |
| xmlAttr * {aka struct _xmlAttr *}
Please reffer Gentoo bug: https://bugs.gentoo.org/923789
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
--- a/src/t4k_menu.c
+++ b/src/t4k_menu.c
@@ -251,9 +251,10 @@ MenuNode *menu_TranslateNode(xmlNode *node) {
/* Now add child nodes. */
if(xmlStrcasecmp(node->name, "menu") == 0) {
i = 0;
- for(child = node->children; child; child = child->next) {
- if(child->type == XML_ELEMENT_NODE) {
- tnode->submenu[i++] = menu_TranslateNode(child);
+ xmlNode *childNode = NULL;
+ for(childNode = node->children; childNode; childNode = childNode->next) {
+ if(childNode->type == XML_ELEMENT_NODE) {
+ tnode->submenu[i++] = menu_TranslateNode(childNode);
}
}
}
@@ -443,7 +444,7 @@ int T4K_RunMenu(int index, bool return_choice, void (*draw_background)(), int (*
int click_flag = 1;
int using_scroll = 0;
- internal_res_switch_handler(&T4K_PrerenderAll);
+ internal_res_switch_handler((ResSwitchCallback)&T4K_PrerenderAll);
for(;;) /* one loop body execution for one menu page */
{
--
2.43.0 |
|
(humble ping) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GNULIB_UNISTR_U8_MBTOUC_UNSAFE tells the bundled unistr.h to provide a function prototype for u8_mbtouc_unsafe. This prevents build failures with future compilers which do not support implicit function declarations.
Upstream gnulib has split the linebreak module into multiple parts; it is hard to tell if it still has the same issue.
Related to:
https://fedoraproject.org/wiki/Changes/PortingToModernC
https://fedoraproject.org/wiki/Toolchain/PortingToModernC