[PATCH] util-linux-ng v2.16 -- pg compiler warning

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

 



On Fri, 17 Jul 2009, Peter Breitenlohner wrote:

Hi Karel,

attached is another small patch, in order to avoid a compiler warning when
NLS is disabled.

Note: with NLS disabled, the result of _() may be const, and actually the
result of gettext() is const as well but unfortunately is not declared as
such.

Regards
Peter Breitenlohner <peb@xxxxxxxxxxxx>
From 1f575fe6aba7f1adb8cac820caea811ccf615345 Mon Sep 17 00:00:00 2001
From: Peter Breitenlohner <peb@xxxxxxxxxxxx>
Date: Mon, 20 Jul 2009 11:35:47 +0200
Subject: [PATCH] pg: compiler warning with NLS disabled


Signed-off-by: Peter Breitenlohner <peb@xxxxxxxxxxxx>
---
 text-utils/pg.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/text-utils/pg.c b/text-utils/pg.c
index 30c6700..b2c4d87 100644
--- a/text-utils/pg.c
+++ b/text-utils/pg.c
@@ -220,7 +220,7 @@ smalloc(size_t s)
 {
         char *m = (char *)malloc(s);
         if (m == NULL) {
-		char *p = _("Out of memory\n");
+		const char *p = _("Out of memory\n");
                 write(2, p, strlen(p));
                 quit(++exitstatus);
         }
@@ -1507,7 +1507,7 @@ found_bw:
 				/*
 				 * Help!
 				 */
-				char *help = _(helpscreen);
+				const char *help = _(helpscreen);
 				write(1, copyright + 4, strlen(copyright + 4));
 				write(1, help, strlen(help));
 				goto newcmd;
-- 
1.6.3.3


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux