summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2019-06-01 18:33:51 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2019-06-01 18:33:51 -0700
commit73e835828184af9230db2176579a4ff74da7785b (patch)
tree27d866a1f91a9cb0a2a3884a04a9e9201f401a88
parent60be69492ae346a89c5e510dfa6af8495c4fa078 (diff)
Use _CONST_X_STRING to make libXt declare String as const char *
Clears gcc 7.3 warnings of: appres.c: In function ‘main’: appres.c:36:16: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] #define NONAME "-AppResTest-" ^ appres.c:126:20: note: in expansion of macro ‘NONAME’ String iname = NONAME, cname = NONAME; ^~~~~~ appres.c:36:16: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] #define NONAME "-AppResTest-" ^ appres.c:126:36: note: in expansion of macro ‘NONAME’ String iname = NONAME, cname = NONAME; ^~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--appres.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/appres.c b/appres.c
index fad870f..e546ac0 100644
--- a/appres.c
+++ b/appres.c
@@ -29,6 +29,8 @@ in this Software without prior written authorization from The Open Group.
# include "config.h"
#endif
+#define _CONST_X_STRING
+
#include <X11/Intrinsic.h>
#include <stdio.h>
#include <stdlib.h>
@@ -123,7 +125,7 @@ int
main (int argc, char *argv[])
{
Widget toplevel;
- char *iname = NONAME, *cname = NONAME;
+ String iname = NONAME, cname = NONAME;
XtAppContext xtcontext;
XrmName names[101];
XrmClass classes[101];