Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various fixes for failing GMP tests #1236

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

lzcunt
Copy link
Contributor

@lzcunt lzcunt commented Jan 28, 2025

Fixes ftell behaviour after ungetc, and adds a simple test for ftell's functionality which also acts as a simple reproducible test case for the failing GMP tests documented in #1221. This test used to fail because our behaviour when checking ftell after a ungetc didn't match glibc.

Adds support for RADIXCHAR and THOUSEP in nl_langinfo, and adds some glibc aliases (not sure if they should be gated or available for all posix targets)

Fixes empty string handling in fputs and adds a simple test for fputs.

Fixes #1221.

Fixes the failing GMP tests documented in managarm#1221.
@lzcunt lzcunt marked this pull request as ready for review January 28, 2025 17:59
This patch adds a simple test for ftell's functionality which also
acts as a simple reproducible test case for the failing GMP tests
documented in managarm#1221. This test used to fail because our behaviour when
checking ftell after a ungetc didn't match glibc.
Also adds DECIMAL_POINT and THOUSAND_SEP which seem to be aliases
originating from glibc.
@lzcunt lzcunt changed the title options/ansi: fix ftell behaviour after ungetc various fixes for failing GMP tests Jan 29, 2025
@lzcunt lzcunt marked this pull request as draft January 29, 2025 21:45
@lzcunt
Copy link
Contributor Author

lzcunt commented Jan 30, 2025

All GMP tests pass when GMP is patched with this tiny patch.

--- a/tests/cxx/clocale.c
+++ b/tests/cxx/clocale.c
@@ -41,7 +41,7 @@ the GNU MP Library test suite.  If not, see https://www.gnu.org/licenses/.  */
 
 extern char point_string[];
 
-#if HAVE_LOCALECONV && ! defined __MINGW32__
+#if HAVE_LOCALECONV && ! defined __MINGW32__ && 0
 struct lconv *
 localeconv (void)
 #if defined __cplusplus && defined __GLIBC__
@@ -54,7 +54,7 @@ localeconv (void)
 }
 #endif
 
-#if HAVE_NL_LANGINFO
+#if HAVE_NL_LANGINFO && 0
 char *
 nl_langinfo (nl_item n)
 #if defined __cplusplus && defined __GLIBC__

@lzcunt lzcunt marked this pull request as ready for review January 30, 2025 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GMP tests for mpz_inp_str fail
1 participant