bugGNU gettext - Bugs: bug #33999, Build fails on Mac OS X 10.7 due...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #33999: Build fails on Mac OS X 10.7 due to stpncpy macro

Submitter:  Stephan Bergmann <stbergmann>
Submitted:  Fri 12 Aug 2011 08:36:58 PM UTC
   
 
Category:  Build Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed

Mon 24 Dec 2012 11:51:18 PM UTC, comment #5: 

I am hitting same fatal error as mentioned above when attempting to compile gettext-0.18.1.1 on OSX 10.8.2   The mentioned patch fixes issue on OSX 10.8.2  I eagerly await next release.

Scott Stensland <eventhorizon>
Fri 30 Mar 2012 10:51:11 PM UTC, comment #4: 

It is now 7 months later (to the day:-) but a release containing this fix hasn't appeared yet...

Any idea when a new release will happen? Otherwise I will have to add yet another patch to my nightly builds (for a project that depends on gettext).

Jack Jansen <jackjansen>
Tue 30 Aug 2011 07:10:32 AM UTC, comment #3: 


> Is the timeline known for the next release (that would contain this fix)?


Since MacOS X is a platform with a large number of users, there
will be a new minor gettext release soon, including this fix.

Bruno Haible <haible>
Group administrator
Tue 30 Aug 2011 12:54:39 AM UTC, comment #2: 

Hello,

Is the timeline known for for the next release (that would contain this fix)? Thanks!

Logan Bowers <loganb>
Sun 14 Aug 2011 11:43:51 AM UTC, comment #1: 

Your analysis and patch is right.

This problem was already fixed in gnulib, see
http://lists.gnu.org/archive/html/bug-gnulib/2010-08/msg00092.html
and
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=c5728261c324a75f8d23dd7d10cb42dde9420227

The fix will be contained in the next gettext release.

Thanks for the report.

Bruno Haible <haible>
Group administrator
Fri 12 Aug 2011 08:36:58 PM UTC, original submission:  

On Mac OS X 10.7 with Xcode 4.1


cd .../gettext-0.18.1.1 && ./configure && make


fails with


libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I.. -I../intl -I../intl -I.. -I.. -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -I../intl -I///usr/include/libxml2 -I./libcroco -g -O2 -c stat.c -o stat.o >/dev/null 2>&1
\
        /bin/sh ../libtool  --tag=CC   --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I..  -I../intl -I../intl -I.. -I.. -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1  -I../intl   -I///usr/include/libxml2 -I./libcroco    -g -O2 -c -o stpncpy.lo stpncpy.c
libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I.. -I../intl -I../intl -I.. -I.. -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -I../intl -I///usr/include/libxml2 -I./libcroco -g -O2 -c stpncpy.c  -fno-common -DPIC -o .libs/stpncpy.o
stpncpy.c:34: error: expected declaration specifiers or ‘...’ before numeric constant
stpncpy.c:34: error: expected ‘)’ before ‘!=’ token
stpncpy.c:34: error: expected ‘)’ before ‘?’ token
make[4]: *** [stpncpy.lo] Error 1
make[3]: *** [all] Error 2
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1


(See also <http://lists.gnu.org/archive/html/bug-gettext/2011-04/msg00005.html>.)

The problem appears to be that gettext-0.18.1.1/gettext-tools/gnulib-m4/stpncpy.m4 erroneously sets REPLACE_STPNCPY=1 even though the stpncpy macro provided by the system would work, because the test program to be executed via AC_TRY_RUN fails to compile.  The following patch fixes that test program accordingly:


--- gettext-0.18.1.1/gettext-tools/gnulib-m4/stpncpy.m4
+++ gettext-0.18.1.1/gettext-tools/gnulib-m4/stpncpy.m4
@@ -31,8 +31,11 @@ AC_DEFUN([gl_FUNC_STPNCPY],
       AC_TRY_RUN([
 #include <stdlib.h>
 #include <string.h> /* for strcpy */
-/* The stpncpy prototype is missing in <string.h> on AIX 4.  */
+/* The stpncpy prototype is missing in <string.h> on AIX 4,
+   but on Mac OS X 10.7 it is defined as a macro in <string.h>.  */
+#if !defined stpncpy
 extern char *stpncpy (char *dest, const char *src, size_t n);
+#endif
 int main () {
   const char *src = "Hello";
   char dest[10];


Stephan Bergmann <stbergmann>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by eventhorizon (Posted a comment)
  • -email is unavailable- added by jackjansen (Posted a comment)
  • -email is unavailable- added by loganb (Posted a comment)
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by stbergmann (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-04 haible StatusFixed Fix Released
    2016-11-27 haible CategoryNone Build
    2011-08-14 haible StatusNone Fixed
        Assigned toNone haible
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code