Re: regex.c value out of range on Solaris compiler

2017-04-16 Thread Gavin Smith
On Sat, Apr 15, 2017 at 02:40:49PM -0700, Paul Eggert wrote:
> Sorry, I don't understand how this could be. regex_internal.h's "#define
> gettext(msgid) msgid" line is in the else-part of the #if that #includes
> libintl.h in its then-part, so how can libintl.h's #define for gettext be
> active when regex_internal's #define is processed?

libintl.h is being included via a system header, /usr/include/locale.h.  
The system header is included from gnulib's locale.h.  locale.h is 
included at the beginning of regex_internal.h.  locale.h is generated 
from locale.in.h.  There's a chance there is something wrong with the 
way I am compiling because headers under /opt/csw/include are being 
checked as well as /usr/share/include.  The log at

https://buildfarm.opencsw.org/buildbot/builders/texinfo-solaris10-i386/builds/1263/steps/shell_2/logs/stdio

doesn't have the same warning, and that is more likely to have been done 
with a correct environment for compiling.  The other logs at 
https://buildfarm.opencsw.org/buildbot/waterfall?category=texinfo
don't have the warning either, so it is probably okay.



Re: regex.c value out of range on Solaris compiler

2017-04-16 Thread Paul Eggert

Thanks for the explanation; I installed the attached further patch.
>From 6ff8421cf8709b1c210b6a15118d3baa2d6685a8 Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Sun, 16 Apr 2017 12:43:20 -0700
Subject: [PATCH] regex: port better to Solaris 10

Solaris 10  includes , which #defines
gettext, and this causes a double #define.
Problem reported by Gavin Smith in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-04/msg00056.html
* lib/regex_internal.h (gettext): #undef before #defining.
---
 ChangeLog| 9 +
 lib/regex_internal.h | 1 +
 2 files changed, 10 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index b19910b..f57c376 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2017-04-16  Paul Eggert  
+
+	regex: port better to Solaris 10
+	Solaris 10  includes , which #defines
+	gettext, and this causes a double #define.
+	Problem reported by Gavin Smith in:
+	http://lists.gnu.org/archive/html/bug-gnulib/2017-04/msg00056.html
+	* lib/regex_internal.h (gettext): #undef before #defining.
+
 2017-04-15  Paul Eggert  
 
 	intprops: improve comments
diff --git a/lib/regex_internal.h b/lib/regex_internal.h
index 9bb0740..8270207 100644
--- a/lib/regex_internal.h
+++ b/lib/regex_internal.h
@@ -102,6 +102,7 @@
   __dcgettext (_libc_intl_domainname, msgid, LC_MESSAGES)
 # endif
 #else
+# undef gettext
 # define gettext(msgid) (msgid)
 #endif
 
-- 
2.7.4