diff options
Diffstat (limited to 'posix')
-rw-r--r-- | posix/Makefile | 2 | ||||
-rw-r--r-- | posix/fnmatch_loop.c | 8 | ||||
-rw-r--r-- | posix/glob.h | 3 | ||||
-rw-r--r-- | posix/regcomp.c | 7 | ||||
-rw-r--r-- | posix/tst-libc-message.c | 48 | ||||
-rw-r--r-- | posix/tst-regex.input | 12 |
6 files changed, 61 insertions, 19 deletions
diff --git a/posix/Makefile b/posix/Makefile index c0e2242..36b8b14 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -348,6 +348,7 @@ tests-internal := \ bug-regex5 \ bug-regex20 \ bug-regex33 \ + tst-libc-message \ # tests-internal tests-container := \ @@ -391,6 +392,7 @@ endif tests-static = \ tst-exec-static \ + tst-libc-message \ tst-spawn-static \ # tests-static diff --git a/posix/fnmatch_loop.c b/posix/fnmatch_loop.c index 9ec5e0e..83f8861 100644 --- a/posix/fnmatch_loop.c +++ b/posix/fnmatch_loop.c @@ -537,7 +537,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end, that it was properly set in the loop above. */ DIAG_PUSH_NEEDS_COMMENT; - DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wmaybe-uninitialized"); + DIAG_IGNORE_NEEDS_COMMENT (16, "-Wmaybe-uninitialized"); if (! is_range # if WIDE_CHAR_VERSION @@ -560,7 +560,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end, above it will be properly set by the loop. */ DIAG_PUSH_NEEDS_COMMENT; - DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wmaybe-uninitialized"); + DIAG_IGNORE_NEEDS_COMMENT (16, "-Wmaybe-uninitialized"); cold = wextra[1 + wextra[0]]; DIAG_POP_NEEDS_COMMENT; # else @@ -745,7 +745,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end, means that it was properly set in the loop above. */ DIAG_PUSH_NEEDS_COMMENT; - DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wmaybe-uninitialized"); + DIAG_IGNORE_NEEDS_COMMENT (16, "-Wmaybe-uninitialized"); cend = wextra[1 + wextra[0]]; DIAG_POP_NEEDS_COMMENT; # else @@ -754,7 +754,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end, wextra above it will be properly set by the loop. */ DIAG_PUSH_NEEDS_COMMENT; - DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wmaybe-uninitialized"); + DIAG_IGNORE_NEEDS_COMMENT (16, "-Wmaybe-uninitialized"); idx += 1 + extra[idx]; DIAG_POP_NEEDS_COMMENT; /* Adjust for the alignment. */ diff --git a/posix/glob.h b/posix/glob.h index 6bb0c6f..e5442dd 100644 --- a/posix/glob.h +++ b/posix/glob.h @@ -195,7 +195,8 @@ extern void globfree64 (glob64_t *__pglob) __THROW; This function is not part of the interface specified by POSIX.2 but several programs want to use it. */ -extern int glob_pattern_p (const char *__pattern, int __quote) __THROW; +extern int glob_pattern_p (const char *__pattern, int __quote) __THROW + __nonnull ((1)); #endif __END_DECLS diff --git a/posix/regcomp.c b/posix/regcomp.c index 69675d8..32043e9 100644 --- a/posix/regcomp.c +++ b/posix/regcomp.c @@ -3301,8 +3301,11 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, #ifdef RE_ENABLE_I18N mbcset, &coll_sym_alloc, #endif /* RE_ENABLE_I18N */ - start_elem.opr.name, - nrules, table_size, symb_table, extra); + start_elem.opr.name +#ifdef _LIBC + , nrules, table_size, symb_table, extra +#endif + ); if (__glibc_unlikely (*err != REG_NOERROR)) goto parse_bracket_exp_free_return; break; diff --git a/posix/tst-libc-message.c b/posix/tst-libc-message.c new file mode 100644 index 0000000..b85195e --- /dev/null +++ b/posix/tst-libc-message.c @@ -0,0 +1,48 @@ +/* Internal test to verify __libc_fatal. + Copyright (C) 2025 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#include <signal.h> +#include <stdio.h> + +#include <support/check.h> +#include <support/capture_subprocess.h> + +static _Noreturn void +run_libc_message (void *closure) +{ + /* We only support 4 arguments. Call with 5 to trigger failure. */ + __libc_message_impl ("%s %s %s %s %s\n", "1", "2", "3", "4", "5"); + __builtin_unreachable (); +} + +static int +do_test (void) +{ + struct support_capture_subprocess result + = support_capture_subprocess (run_libc_message, NULL); + support_capture_subprocess_check (&result, "libc_message", -SIGABRT, + sc_allow_stderr); + + TEST_COMPARE_STRING (result.err.buffer, IOVEC_MAX_ERR_MSG); + + support_capture_subprocess_free (&result); + + return 0; +} + +#include <support/test-driver.c> diff --git a/posix/tst-regex.input b/posix/tst-regex.input index 1de30b3..38b8db6 100644 --- a/posix/tst-regex.input +++ b/posix/tst-regex.input @@ -8423,11 +8423,6 @@ * sysdeps/libm-ieee754/s_exp2f.c (__exp2f_deltatable): Renamed from __exp2_deltatable. -1998-02-26 Ulrich Drepper <drepper@cygnus.com> - - * nis/ypclnt.c (yp_master): Check result of strdup. - Patch by Thorsten Kukuk. - 1998-02-26 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> * nis/ypclnt.c: Give clnt handle after error checking free, change @@ -11089,13 +11084,6 @@ inline functions by feature tests to avoid warning about missing prototype declarations. -1997-12-09 15:08 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> - - * nis/nss_compat/compat-grp.c: Reset the blacklist correct, fix - return code for non existent +name entries. - * nis/nss_compat/compat-pwd.c: Likewise. - * nis/nss_compat/compat-spwd.c: Likewise. - 1997-12-10 13:52 Philip Blundell <pb@nexus.co.uk> * sysdeps/standalone/arm/bits/errno.h (EAGAIN): Added. |