This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gettext compilation warnings



When compiling GNU hello 1.3.18 with glibc's intl/ instead of the old one, on a
glibc-2.1.x system, there are a few warnings:

gcc -c -DLOCALEDIR=\"/usr/local/share/locale\" -DGNULOCALEDIR=\"/usr/local/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/local/share/locale:.\" -DLIBDIR=\"/usr/local/lib\" -DHAVE_CONFIG_H -I.. -I. -I../../intl -I../../lib  -g -O2  ../../intl/dcigettext.c
../../intl/dcigettext.c: In function `dcigettext__':
../../intl/dcigettext.c:594: warning: assignment makes pointer from integer without a cast

gcc -c -DLOCALEDIR=\"/usr/local/share/locale\" -DGNULOCALEDIR=\"/usr/local/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/local/share/locale:.\" -DLIBDIR=\"/usr/local/lib\" -DHAVE_CONFIG_H -I.. -I. -I../../intl -I../../lib  -g -O2  ../../intl/l10nflist.c
../../intl/l10nflist.c: In function `_nl_make_l10nflist':
../../intl/l10nflist.c:230: warning: assignment makes pointer from integer without a cast
../../intl/l10nflist.c:235: warning: assignment makes pointer from integer without a cast
../../intl/l10nflist.c:240: warning: assignment makes pointer from integer without a cast
../../intl/l10nflist.c:245: warning: assignment makes pointer from integer without a cast
../../intl/l10nflist.c:252: warning: assignment makes pointer from integer without a cast
../../intl/l10nflist.c:257: warning: assignment makes pointer from integer without a cast
../../intl/l10nflist.c:263: warning: assignment makes pointer from integer without a cast
../../intl/l10nflist.c:267: warning: assignment makes pointer from integer without a cast
../../intl/l10nflist.c: In function `_nl_normalize_codeset':
../../intl/l10nflist.c:379: warning: assignment makes pointer from integer without a cast

These occur because mempcpy and stpcpy don't get declared. This is because
at the moment <string.h> gets included, __USE_GNU is not defined. At this
moment, _GNU_SOURCE is set, but it has been set too late. GNU hello's
<config.h> includes <libintl.h> which includes <locale.h> which includes
<features.h>, before _GNU_SOURCE was set. Fix:

2000-04-23  Bruno Haible  <clisp.cons.org>

	* intl/dcigettext.c: Define _GNU_SOURCE as early as possible.
	* intl/l10nflist.c: Likewise.

*** intl/dcigettext.c.bak	Sun Apr 23 18:41:13 2000
--- intl/dcigettext.c	Sun Apr 23 22:13:48 2000
***************
*** 16,21 ****
--- 16,28 ----
     write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.  */
  
+ /* Tell glibc's <string.h> to provide a prototype for mempcpy().
+    This must come before <config.h> because <config.h> may include
+    <features.h>, and once <features.h> has been included, it's too late.  */
+ #ifndef _GNU_SOURCE
+ # define _GNU_SOURCE	1
+ #endif
+ 
  #ifdef HAVE_CONFIG_H
  # include <config.h>
  #endif
***************
*** 59,67 ****
  #endif
  
  #if defined HAVE_STRING_H || defined _LIBC
- # ifndef _GNU_SOURCE
- #  define _GNU_SOURCE	1
- # endif
  # include <string.h>
  #else
  # include <strings.h>
--- 66,71 ----
*** intl/l10nflist.c.bak	Mon Feb 28 11:34:05 2000
--- intl/l10nflist.c	Sun Apr 23 22:23:26 2000
***************
*** 16,30 ****
     write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.  */
  
  #ifdef HAVE_CONFIG_H
  # include <config.h>
  #endif
  
  
  #if defined HAVE_STRING_H || defined _LIBC
- # ifndef _GNU_SOURCE
- #  define _GNU_SOURCE	1
- # endif
  # include <string.h>
  #else
  # include <strings.h>
--- 16,34 ----
     write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     Boston, MA 02111-1307, USA.  */
  
+ /* Tell glibc's <string.h> to provide a prototype for stpcpy().
+    This must come before <config.h> because <config.h> may include
+    <features.h>, and once <features.h> has been included, it's too late.  */
+ #ifndef _GNU_SOURCE
+ # define _GNU_SOURCE	1
+ #endif
+ 
  #ifdef HAVE_CONFIG_H
  # include <config.h>
  #endif
  
  
  #if defined HAVE_STRING_H || defined _LIBC
  # include <string.h>
  #else
  # include <strings.h>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]