[PATCH 10/25] OsInit: store "/dev/null" in a const char *

Alan Coopersmith alan.coopersmith at oracle.com
Sun Dec 11 10:16:23 PST 2011


It's only passed as the input side of a strcpy and as the filename to
fopen, so doesn't need to be non-const.   Fixes gcc warning:

osinit.c: In function 'OsInit':
osinit.c:154:28: warning: initialization discards qualifiers from pointer target type

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 os/osinit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/os/osinit.c b/os/osinit.c
index acea682..ff3c45d 100644
--- a/os/osinit.c
+++ b/os/osinit.c
@@ -151,7 +151,7 @@ void
 OsInit(void)
 {
     static Bool been_here = FALSE;
-    static char* devnull = "/dev/null";
+    static const char* devnull = "/dev/null";
     char fname[PATH_MAX];
 
     if (!been_here) {
-- 
1.7.3.2



More information about the xorg-devel mailing list