FreeBSD Bugzilla – Attachment 211766 Details for
Bug 244235
x11/xkbcomp: Fix build with clang 10.0.0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Use strcmp instead of custom macros
x11__xkbcomp-fix-strcmp-1.diff (text/plain), 2.84 KB, created by
Dimitry Andric
on 2020-02-19 19:42:57 UTC
(
hide
)
Description:
Use strcmp instead of custom macros
Filename:
MIME Type:
Creator:
Dimitry Andric
Created:
2020-02-19 19:42:57 UTC
Size:
2.84 KB
patch
obsolete
>Fix clang 10.0.0 errors: > >xkbcomp.c:228:37: error: result of comparison against a string literal is unspecified (use an explicit string comparison function instead) [-Werror,-Wstring-compare] > if ((argv[i][0] != '-') || (uStringEqual(argv[i], "-"))) > ^~~~~~~~~~~~~~~~~~~~~~~~~~ >./utils.h:195:30: note: expanded from macro 'uStringEqual' >#define uStringEqual(s1,s2) (uStringCompare(s1,s2)==Equal) > ^~~~~~~~~~~~~~~~~~~~~ >./utils.h:198:38: note: expanded from macro 'uStringCompare' > (s1)!=(s2):strcmp(s1,s2)) > ^ ~~~~ > >Don't attempt to do this macro trickery, and simply use strcmp instead, >where it applies. > >Index: x11/xkbcomp/files/patch-xkbcomp.c >=================================================================== >--- x11/xkbcomp/files/patch-xkbcomp.c (nonexistent) >+++ x11/xkbcomp/files/patch-xkbcomp.c (working copy) >@@ -0,0 +1,47 @@ >+--- xkbcomp.c.orig 2018-06-07 23:17:28 UTC >++++ xkbcomp.c >+@@ -225,7 +225,7 @@ parseArgs(int argc, char *argv[]) >+ for (i = 1; i < argc; i++) >+ { >+ int itmp; >+- if ((argv[i][0] != '-') || (uStringEqual(argv[i], "-"))) >++ if ((argv[i][0] != '-') || (strcmp(argv[i], "-") == 0)) >+ { >+ if (!xkblist) >+ { >+@@ -651,7 +651,7 @@ parseArgs(int argc, char *argv[]) >+ ERROR("No input file specified\n"); >+ return False; >+ } >+- else if (uStringEqual(inputFile, "-")) >++ else if (strcmp(inputFile, "-") == 0) >+ { >+ inputFormat = INPUT_XKB; >+ } >+@@ -755,7 +755,7 @@ parseArgs(int argc, char *argv[]) >+ return False; >+ } >+ } >+- else if ((!outputFile) && (inputFile) && uStringEqual(inputFile, "-")) >++ else if ((!outputFile) && (inputFile) && (strcmp(inputFile, "-") == 0)) >+ { >+ int len = strlen("stdin") + strlen(fileTypeExt[outputFormat]) + 2; >+ outputFile = uTypedCalloc(len, char); >+@@ -930,7 +930,7 @@ main(int argc, char *argv[]) >+ } >+ if (inputFile != NULL) >+ { >+- if (uStringEqual(inputFile, "-")) >++ if (strcmp(inputFile, "-") == 0) >+ { >+ file = stdin; >+ inputFile = "stdin"; >+@@ -1132,7 +1132,7 @@ main(int argc, char *argv[]) >+ } >+ if (outputFile != NULL) >+ { >+- if (uStringEqual(outputFile, "-")) >++ if (strcmp(outputFile, "-") == 0) >+ outputFile = "stdout"; >+ else >+ { > >Property changes on: x11/xkbcomp/files/patch-xkbcomp.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 244235
: 211766