mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-02-27 17:47:29 +02:00
* gl/lib/mbsalign.c (mbsalign): Mark unused parameter. * bootstrap.conf (gnulib_modules): Remove obsolete rename-dest-slash. * gnulib-tests/Makefile.am (AM_CFLAGS): Reduce set of warnings for gnulib tests. * gl/modules/rename-tests.diff (Makefile.am): New file, to add LIBINTL to LDADD, since we avoid canonicalize-lgpl module. * gl/lib/regcomp.c.diff (regerror, calc_next) (build_collating_symbol, parse_bracket_element, build_equiv_class) (free_tree): Mark unused parameters. * gl/lib/regex_internal.h.diff (re_string_elem_size_at): New file, to mark unused parameters. * gl/lib/printf-args.c.diff (PRINTF_FETCHARGS): New file, to avoid type mismatch. * gl/lib/vasnprintf.c (VASNPRINTF): New file, to avoid shadowing local variable name. * .gitignore: Ignore temporary build artifacts.
83 lines
3.0 KiB
Diff
83 lines
3.0 KiB
Diff
diff --git c/lib/regcomp.c i/lib/regcomp.c
|
|
index 6472ff6..665b2ab 100644
|
|
--- c/lib/regcomp.c
|
|
+++ i/lib/regcomp.c
|
|
@@ -18,6 +18,8 @@
|
|
with this program; if not, write to the Free Software Foundation,
|
|
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
|
|
|
+#include "intprops.h"
|
|
+#include "verify.h"
|
|
static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern,
|
|
size_t length, reg_syntax_t syntax);
|
|
static void re_compile_fastmap_iter (regex_t *bufp,
|
|
@@ -541,7 +543,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
|
|
size_t errbuf_size;
|
|
#else /* size_t might promote */
|
|
size_t
|
|
-regerror (int errcode, const regex_t *_Restrict_ preg,
|
|
+regerror (int errcode, const regex_t *_Restrict_ preg _UNUSED_PARAMETER_,
|
|
char *_Restrict_ errbuf, size_t errbuf_size)
|
|
#endif
|
|
{
|
|
@@ -1375,7 +1377,7 @@ calc_first (void *extra, bin_tree_t *node)
|
|
|
|
/* Pass 2: compute NEXT on the tree. Preorder visit. */
|
|
static reg_errcode_t
|
|
-calc_next (void *extra, bin_tree_t *node)
|
|
+calc_next (void *extra _UNUSED_PARAMETER_, bin_tree_t *node)
|
|
{
|
|
switch (node->token.type)
|
|
{
|
|
@@ -2571,7 +2573,8 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
|
|
/* This loop is actually executed only when end != REG_MISSING,
|
|
to rewrite <re>{0,n} as (<re>(<re>...<re>?)?)?... We have
|
|
already created the start+1-th copy. */
|
|
- if ((Idx) -1 < 0 || end != REG_MISSING)
|
|
+ verify (! TYPE_SIGNED (Idx));
|
|
+ if (end != REG_MISSING)
|
|
for (i = start + 2; i <= end; ++i)
|
|
{
|
|
elem = duplicate_tree (elem, dfa);
|
|
@@ -2731,7 +2734,8 @@ static reg_errcode_t
|
|
internal_function
|
|
build_collating_symbol (bitset_t sbcset,
|
|
# ifdef RE_ENABLE_I18N
|
|
- re_charset_t *mbcset, Idx *coll_sym_alloc,
|
|
+ re_charset_t *mbcset _UNUSED_PARAMETER_,
|
|
+ Idx *coll_sym_alloc _UNUSED_PARAMETER_,
|
|
# endif
|
|
const unsigned char *name)
|
|
{
|
|
@@ -3309,7 +3313,8 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
|
|
|
|
static reg_errcode_t
|
|
parse_bracket_element (bracket_elem_t *elem, re_string_t *regexp,
|
|
- re_token_t *token, int token_len, re_dfa_t *dfa,
|
|
+ re_token_t *token, int token_len,
|
|
+ re_dfa_t *dfa _UNUSED_PARAMETER_,
|
|
reg_syntax_t syntax, bool accept_hyphen)
|
|
{
|
|
#ifdef RE_ENABLE_I18N
|
|
@@ -3396,8 +3401,9 @@ parse_bracket_symbol (bracket_elem_t *elem, re_string_t *regexp,
|
|
|
|
static reg_errcode_t
|
|
#ifdef RE_ENABLE_I18N
|
|
-build_equiv_class (bitset_t sbcset, re_charset_t *mbcset,
|
|
- Idx *equiv_class_alloc, const unsigned char *name)
|
|
+build_equiv_class (bitset_t sbcset, re_charset_t *mbcset _UNUSED_PARAMETER_,
|
|
+ Idx *equiv_class_alloc _UNUSED_PARAMETER_,
|
|
+ const unsigned char *name)
|
|
#else /* not RE_ENABLE_I18N */
|
|
build_equiv_class (bitset_t sbcset, const unsigned char *name)
|
|
#endif /* not RE_ENABLE_I18N */
|
|
@@ -3798,7 +3804,7 @@ free_token (re_token_t *node)
|
|
and its children. */
|
|
|
|
static reg_errcode_t
|
|
-free_tree (void *extra, bin_tree_t *node)
|
|
+free_tree (void *extra _UNUSED_PARAMETER_, bin_tree_t *node)
|
|
{
|
|
free_token (&node->token);
|
|
return REG_NOERROR;
|