All of lore.kernel.org
 help / color / mirror / Atom feed
* mconf.c and bindtextdomain() -- warnings while cross-compiling on OS X
@ 2008-05-04  3:58 Timur Tabi
  2008-05-04  7:33 ` Sam Ravnborg
  0 siblings, 1 reply; 4+ messages in thread
From: Timur Tabi @ 2008-05-04  3:58 UTC (permalink / raw)
  To: linux-kernel

I'm cross-compiling the kernel on an OS X system, and when I run "make 
menuconfig", I get this warning:

   HOSTCC  scripts/kconfig/mconf.o
scripts/kconfig/mconf.c: In function ‘main’:
scripts/kconfig/mconf.c:871: warning: statement with no effect
scripts/kconfig/mconf.c:872: warning: statement with no effect

Here is the code in question:

int main(int ac, char **av)
{
	int saved_x, saved_y;
	char *mode;
	int res;

	setlocale(LC_ALL, "");
	bindtextdomain(PACKAGE, LOCALEDIR);  <--- line 871
	textdomain(PACKAGE);

I believe the warnings are from this code in lkc.h:

#ifndef KBUILD_NO_NLS
# include <libintl.h>
#else
# define gettext(Msgid) ((const char *) (Msgid))
# define textdomain(Domainname) ((const char *) (Domainname))
# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
#endif

Can someone explain to me why this macros are defined in this way? Every 
place where textdomain() and bindtext() are used, they are used like this:

	bindtextdomain(PACKAGE, LOCALEDIR);
	textdomain(PACKAGE);

In other words, the return value from these macros is never used, so the 
warning is inevitable.

I think the code in lkc.h should be changed to:

# define textdomain(Domainname) do {} while(0)
# define bindtextdomain(Domainname, Dirname) do {} while(0)

I can't say for certain whether this is a good idea, though, because I'm 
not at all familiar with this code.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-05-04 19:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-04  3:58 mconf.c and bindtextdomain() -- warnings while cross-compiling on OS X Timur Tabi
2008-05-04  7:33 ` Sam Ravnborg
2008-05-04 18:42   ` Timur Tabi
2008-05-04 19:08     ` Sam Ravnborg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.