bug-m4
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: m4 failure on OS X High Sierra, with patch


From: Eric Blake
Subject: Re: m4 failure on OS X High Sierra, with patch
Date: Mon, 25 Jun 2018 10:05:58 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 06/23/2018 01:48 PM, George Hartzell wrote:

Hi All,

I'm ensuring that the Spack packager can build m4 on OS X High Sierra.

Here's my PR for them:

     https://github.com/spack/spack/pull/8559

Making someone chase a URL is not friendly for long-term archives. Here's a summary:

+With format string strictness, High Sierra also enforces that %n isn't used
+in dynamic format strings, but we should just disable its use on darwin in
+general.
+
+--- a/lib/vasnprintf.c.orig    2017-06-22 15:19:15.000000000 -0700
++++ b/lib/vasnprintf.c 2017-06-22 15:20:20.000000000 -0700
+@@ -4869,7 +4869,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *
+ #endif
+                   *fbp = dp->conversion;
+ #if USE_SNPRINTF
+-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) ++# if !defined(__APPLE__) && !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+                 fbp[1] = '%';
+                 fbp[2] = 'n';
+                 fbp[3] = '\0';

In other words, you are patching gnulib to work around MacOS's new strictness that prevents the POSIX-compliant use of %n within snprintf(). As similar patches have already been made in upstream gnulib, the next release of m4 should automatically work with newer MacOS by virtue of updating to a newer gnulib.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]