summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeyi Guo <heyi.guo@linaro.org>2016-12-15 14:49:45 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2016-12-20 11:12:01 +0800
commit5b26adf03a0b66b741ff05daee985888fe1d636f (patch)
tree259963bedea7fd2d64235356a432e7cd3c818783
parent9a882490e450012d68a908a191dd5c624fa618ca (diff)
downloadedk2-platforms-5b26adf03a0b66b741ff05daee985888fe1d636f.tar.xz
BaseTools: fix format-security build warnings
Fix build warnings of "format not a string literal and no format arguments [-Wformat-security]" for BaseTools, while using "gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)". Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Heyi Guo <heyi.guo@linaro.org> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/fset2.c2
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c2
-rw-r--r--BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c8
3 files changed, 6 insertions, 6 deletions
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/fset2.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/fset2.c
index 7f686a53d5..fe1b4d6242 100644
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/fset2.c
+++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/fset2.c
@@ -2210,7 +2210,7 @@ void MR_backTraceReport()
if (p->ntype != nToken) continue;
tn=(TokNode *)p;
if (depth != 0) fprintf(stdout," ");
- fprintf(stdout,TerminalString(tn->token));
+ fprintf(stdout, "%s", TerminalString(tn->token));
depth++;
if (! MR_AmbAidMultiple) {
if (set_nil(tn->tset)) {
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c
index 368a96b9ac..b99054534b 100644
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c
+++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c
@@ -3866,7 +3866,7 @@ int file;
/* MR10 */ _gen(" * ");
/* MR10 */ for (i=0 ; i < Save_argc ; i++) {
/* MR10 */ _gen(" ");
-/* MR10 */ _gen(Save_argv[i]);
+/* MR10 */ _gen1("%s", Save_argv[i]);
/* MR10 */ };
_gen("\n");
_gen(" *\n");
diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c b/BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c
index 8c524fe465..a4e7f69b36 100644
--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c
+++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c
@@ -706,7 +706,7 @@ FILE *output;
/* MR26 */ if (! (isalpha(*t) || isdigit(*t) || *t == '_' || *t == '$')) break;
/* MR26 */ }
/* MR26 */ }
-/* MR26 */ fprintf(output,strBetween(pSymbol, t, pSeparator));
+/* MR26 */ fprintf(output, "%s", strBetween(pSymbol, t, pSeparator));
*q = p;
return (*pSeparator == 0);
@@ -771,7 +771,7 @@ FILE *f;
&pValue,
&pSeparator,
&nest);
- fprintf(f,strBetween(pDataType, pSymbol, pSeparator));
+ fprintf(f, "%s", strBetween(pDataType, pSymbol, pSeparator));
}
/* check to see if string e is a word in string s */
@@ -852,9 +852,9 @@ int i;
&pSeparator,
&nest);
fprintf(f,"\t");
- fprintf(f,strBetween(pDataType, pSymbol, pSeparator));
+ fprintf(f, "%s", strBetween(pDataType, pSymbol, pSeparator));
fprintf(f," ");
- fprintf(f,strBetween(pSymbol, pEqualSign, pSeparator));
+ fprintf(f, "%s", strBetween(pSymbol, pEqualSign, pSeparator));
fprintf(f,";\n");
}
fprintf(f,"};\n");