Subject: compilation error (-Wunused-macros) with gcc-5.2
From: Assaf Gordon <[email-masked]>
To: [email-masked]
Date: Thu, 23 Jul 2015 17:42:19 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

compiling sed from git (v4.2.2-89-ge387009) fails with gcd-5.2 due to -Wunused-macros (and -Werror):

===
make[3]: Entering directory `/home/gordon/sources/sed/sed'
   CC       compile.o
compile.c:36:0: error: macro "OPEN_BRACE" is not used [-Werror=unused-macros]
  #define OPEN_BRACE '{'
  ^
compile.c:183:0: error: macro "END_ERRORS" is not used [-Werror=unused-macros]
  #define END_ERRORS (INCOMPLETE_CMD + sizeof(N_("incomplete command")))
  ^
cc1: all warnings being treated as errors
make[3]: *** [compile.o] Error 1
===

The attached patch comments-out the two macros. Alternatively they could be simply erased.

regards,
  - assaf

P.S.
I don't yet have copyright assignment for sed, but I think this change is trivial enough.
From 9f3be7fc52f3b5b8f8dab5941f1173806526f786 Mon Sep 17 00:00:00 2001
From: Assaf Gordon <[email-masked]>
Date: Thu, 23 Jul 2015 17:23:20 -0400
Subject: [PATCH] build: comment-out unused macros

* sed/compile.c: comment-out OPEN_BRACE, END_ERRORS to prevent gcc-5.2
  from failing with -Werror -Wunused-macros.
---
 sed/compile.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sed/compile.c b/sed/compile.c
index 51fd24d..51103e5 100644
--- a/sed/compile.c
+++ b/sed/compile.c
@@ -33,7 +33,7 @@
 /* let's not confuse text editors that have only dumb bracket-matching... */
 #define OPEN_BRACKET	'['
 #define CLOSE_BRACKET	']'
-#define OPEN_BRACE	'{'
+/* #define OPEN_BRACE	'{' */
 #define CLOSE_BRACE	'}'
 
 struct prog_info {
@@ -180,7 +180,7 @@ static const char errors[] =
 #define UNKNOWN_CMD (INVALID_LINE_0 \
   + sizeof(N_("invalid usage of line address 0")))
 #define INCOMPLETE_CMD (UNKNOWN_CMD + sizeof(N_("unknown command: `%c'")))
-#define END_ERRORS (INCOMPLETE_CMD + sizeof(N_("incomplete command")))
+/* #define END_ERRORS (INCOMPLETE_CMD + sizeof(N_("incomplete command"))) */
 
 static struct output *file_read = NULL;
 static struct output *file_write = NULL;
-- 
1.9.1