This is the mail archive of the libc-alpha@sources.redhat.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]
Other format: [Raw text]

__dcngettext_internal



Seen while compiling glibc-20020425 with --enable-all-warnings:

dngettext.c:56: warning: implicit declaration of function `__dcngettext_internal'
dngettext.c:56: warning: return makes pointer from integer without a cast
ngettext.c:63: warning: implicit declaration of function `__dcngettext_internal'
ngettext.c:63: warning: return makes pointer from integer without a cast

There are two ways to fix this. Please choose.

1) Simply declare __dcngettext_internal.

2) The __dcngettext function was never used outside glibc. (Yes, the ngettext
family of functions was introduced after the macro for gettext() that relies
on __dcgettext had been removed from libintl.h.) So just don't export
__dcngettext from libc.


PS: Maybe I should add attribute_hidden in one patch or the other; I can't
tell because in include/libc-symbols.h there is no comment saying what
attribute_hidden means (wink wink), and on my system it appears to make no


Patch 1: Declare __dcngettext_internal. Also add the same attributes to the
declarations, as in intl/libintl.h. I know this is not necessary for gcc, but
I find it less confusing if two declarations of the same function agree.

2002-04-26  Bruno Haible  <bruno@clisp.org>

	* include/libintl.h (__ngettext, __dngettext, __dcngettext,
	__dcngettext_internal): New declarations.
	(__gettext, __dgettext, __dcgettext, __dcgettext_internal): Add
	attribute declarations.

difference for symbols that are not listed in some Versions file.
--- glibc-20020425/include/libintl.h.bak	2002-04-20 02:38:12.000000000 +0200
+++ glibc-20020425/include/libintl.h	2002-04-26 01:08:17.000000000 +0200
@@ -3,19 +3,43 @@
 #include <locale.h>
 
 /* Now define the internal interfaces.  */
-extern char *__gettext (__const char *__msgid);
+extern char *__gettext (__const char *__msgid)
+     __attribute_format_arg__ (1);
 extern char *__dgettext (__const char *__domainname,
-			 __const char *__msgid);
+			 __const char *__msgid)
+     __attribute_format_arg__ (2);
 extern char *__dcgettext (__const char *__domainname,
-			  __const char *__msgid, int __category);
+			  __const char *__msgid, int __category)
+     __attribute_format_arg__ (2);
 extern char *__dcgettext_internal (__const char *__domainname,
 				   __const char *__msgid, int __category)
+     __attribute_format_arg__ (2)
      attribute_hidden;
+
+extern char *__ngettext (__const char *__msgid1, __const char *__msgid2,
+			 unsigned long int __n)
+     __attribute_format_arg__ (1) __attribute_format_arg__ (2);
+extern char *__dngettext (__const char *__domainname,
+			  __const char *__msgid1, __const char *__msgid2,
+			  unsigned long int __n)
+     __attribute_format_arg__ (2) __attribute_format_arg__ (3);
+extern char *__dcngettext (__const char *__domainname,
+			   __const char *__msgid1, __const char *__msgid2,
+			   unsigned long int __n, int __category)
+     __attribute_format_arg__ (2) __attribute_format_arg__ (3);
+extern char *__dcngettext_internal (__const char *__domainname,
+				    __const char *__msgid1,
+				    __const char *__msgid2,
+				    unsigned long int __n, int __category)
+     __attribute_format_arg__ (2) __attribute_format_arg__ (3)
+     attribute_hidden;
+
 extern char *__textdomain (__const char *__domainname);
 extern char *__bindtextdomain (__const char *__domainname,
 			       __const char *__dirname);
 extern char *__bind_textdomain_codeset (__const char *__domainname,
 					__const char *__codeset);
+
 extern const char _libc_intl_domainname[];
 extern const char _libc_intl_domainname_internal[] attribute_hidden;
 


Patch 2: Make __dcngettext libc-static.

2002-04-26  Bruno Haible  <bruno@clisp.org>

	* include/libintl.h (__ngettext, __dngettext, __dcngettext): New
	declarations.
	(__gettext, __dgettext, __dcgettext, __dcgettext_internal): Add
	attribute declarations.
	* intl/Versions: Remove __dcngettext.
	* intl/dcngettext.c (__dcngettext_internal): Remove alias.
	* intl/dngettext.c: Use __dcngettext instead of __dcngettext_internal.
	* intl/ngettext.c: Likewise.

--- glibc-20020425/include/libintl.h.bak	Sat Apr 20 02:38:12 2002
+++ glibc-20020425/include/libintl.h	Fri Apr 26 11:21:31 2002
@@ -3,19 +3,37 @@
 #include <locale.h>
 
 /* Now define the internal interfaces.  */
-extern char *__gettext (__const char *__msgid);
+extern char *__gettext (__const char *__msgid)
+     __attribute_format_arg__ (1);
 extern char *__dgettext (__const char *__domainname,
-			 __const char *__msgid);
+			 __const char *__msgid)
+     __attribute_format_arg__ (2);
 extern char *__dcgettext (__const char *__domainname,
-			  __const char *__msgid, int __category);
+			  __const char *__msgid, int __category)
+     __attribute_format_arg__ (2);
 extern char *__dcgettext_internal (__const char *__domainname,
 				   __const char *__msgid, int __category)
+     __attribute_format_arg__ (2)
      attribute_hidden;
+
+extern char *__ngettext (__const char *__msgid1, __const char *__msgid2,
+			 unsigned long int __n)
+     __attribute_format_arg__ (1) __attribute_format_arg__ (2);
+extern char *__dngettext (__const char *__domainname,
+			  __const char *__msgid1, __const char *__msgid2,
+			  unsigned long int __n)
+     __attribute_format_arg__ (2) __attribute_format_arg__ (3);
+extern char *__dcngettext (__const char *__domainname,
+			   __const char *__msgid1, __const char *__msgid2,
+			   unsigned long int __n, int __category)
+     __attribute_format_arg__ (2) __attribute_format_arg__ (3);
+
 extern char *__textdomain (__const char *__domainname);
 extern char *__bindtextdomain (__const char *__domainname,
 			       __const char *__dirname);
 extern char *__bind_textdomain_codeset (__const char *__domainname,
 					__const char *__codeset);
+
 extern const char _libc_intl_domainname[];
 extern const char _libc_intl_domainname_internal[] attribute_hidden;
 
--- glibc-20020425/intl/Versions.bak	Mon Sep 18 22:07:48 2000
+++ glibc-20020425/intl/Versions	Fri Apr 26 01:25:05 2002
@@ -19,9 +19,6 @@
     textdomain;
   }
   GLIBC_2.2 {
-    # functions used in inline functions or macros
-    __dcngettext;
-
     # b*
     bind_textdomain_codeset;
 
--- glibc-20020425/intl/dcngettext.c.bak	Tue Apr  9 21:27:28 2002
+++ glibc-20020425/intl/dcngettext.c	Fri Apr 26 11:39:14 2002
@@ -57,6 +57,5 @@
 
 #ifdef _LIBC
 /* Alias for function name in GNU C Library.  */
-INTDEF(__dcngettext)
 weak_alias (__dcngettext, dcngettext);
 #endif
--- glibc-20020425/intl/dngettext.c.bak	Mon Apr 15 20:54:57 2002
+++ glibc-20020425/intl/dngettext.c	Fri Apr 26 11:23:44 2002
@@ -38,7 +38,7 @@
    prefix.  So we have to make a difference here.  */
 #ifdef _LIBC
 # define DNGETTEXT __dngettext
-# define DCNGETTEXT INTUSE(__dcngettext)
+# define DCNGETTEXT __dcngettext
 #else
 # define DNGETTEXT dngettext__
 # define DCNGETTEXT dcngettext__
--- glibc-20020425/intl/ngettext.c.bak	Mon Apr 15 20:54:57 2002
+++ glibc-20020425/intl/ngettext.c	Fri Apr 26 11:24:01 2002
@@ -45,7 +45,7 @@
    prefix.  So we have to make a difference here.  */
 #ifdef _LIBC
 # define NGETTEXT __ngettext
-# define DCNGETTEXT INTUSE(__dcngettext)
+# define DCNGETTEXT __dcngettext
 #else
 # define NGETTEXT ngettext__
 # define DCNGETTEXT dcngettext__


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