bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: clang warnings in regcomp.c
Date: Mon, 07 Sep 2020 02:45:54 +0200	[thread overview]
Message-ID: <4352488.g1GkCYmLPv@omega> (raw)

clang produces these warning about regcomp.c:

regcomp.c(40,25): warning: redundant parentheses surrounding declarator [-Wredundant-parens]
regcomp.c(43,19): warning: redundant parentheses surrounding declarator [-Wredundant-parens]
regcomp.c(1226,44): warning: redundant parentheses surrounding declarator [-Wredundant-parens]
regcomp.c(1258,43): warning: redundant parentheses surrounding declarator [-Wredundant-parens]

What is the point of these parentheses?

Would this patch be OK (also in glibc)?


diff --git a/lib/regcomp.c b/lib/regcomp.c
index 692928b..392d125 100644
--- a/lib/regcomp.c
+++ b/lib/regcomp.c
@@ -37,10 +37,10 @@ static void optimize_utf8 (re_dfa_t *dfa);
 #endif
 static reg_errcode_t analyze (regex_t *preg);
 static reg_errcode_t preorder (bin_tree_t *root,
-			       reg_errcode_t (fn (void *, bin_tree_t *)),
+			       reg_errcode_t fn (void *, bin_tree_t *),
 			       void *extra);
 static reg_errcode_t postorder (bin_tree_t *root,
-				reg_errcode_t (fn (void *, bin_tree_t *)),
+				reg_errcode_t fn (void *, bin_tree_t *),
 				void *extra);
 static reg_errcode_t optimize_subexps (void *extra, bin_tree_t *node);
 static reg_errcode_t lower_subexps (void *extra, bin_tree_t *node);
@@ -1223,7 +1223,7 @@ analyze (regex_t *preg)
    implement parse tree visits.  Instead, we use parent pointers and
    some hairy code in these two functions.  */
 static reg_errcode_t
-postorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)),
+postorder (bin_tree_t *root, reg_errcode_t fn (void *, bin_tree_t *),
 	   void *extra)
 {
   bin_tree_t *node, *prev;
@@ -1255,7 +1255,7 @@ postorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)),
 }
 
 static reg_errcode_t
-preorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)),
+preorder (bin_tree_t *root, reg_errcode_t fn (void *, bin_tree_t *),
 	  void *extra)
 {
   bin_tree_t *node;



             reply	other threads:[~2020-09-07  0:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-07  0:45 Bruno Haible [this message]
2020-09-07  2:05 ` clang warnings in regcomp.c Paul Eggert
2020-10-10 10:45   ` Bruno Haible

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4352488.g1GkCYmLPv@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).