--- Begin Message ---
Subject: |
[PATCH] grep: mark matchers table const |
Date: |
Fri, 3 Nov 2017 03:03:43 -0500 |
* src/grep.c (matchers): Mark const.
---
src/grep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/grep.c b/src/grep.c
index 2277a60..0643a7e 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -2003,7 +2003,7 @@ if any error occurs and -q is not given, the exit status
is 2.\n"));
/* Pattern compilers and matchers. */
-static struct
+static const struct
{
char const name[12];
int syntax; /* used if compile == GEAcompile */
--
2.15.0
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#29123: [PATCH] grep: mark matchers table const |
Date: |
Fri, 3 Nov 2017 01:45:07 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
Zev Weiss wrote:
-static struct
+static const struct
{
char const name[12];
There's already a const after the } at the end of the struct, so this 'const' is
not needed. The usual style in 'grep' is to put the 'const' after the type, not
before it.
Come to think of it, the 'const' in front of 'name' is also a duplicate, so I
installed the attached.
0001-grep-omit-a-dup-const.patch
Description: Text Data
--- End Message ---