]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: fix format-security build warnings
authorHeyi Guo <heyi.guo@linaro.org>
Thu, 15 Dec 2016 06:49:45 +0000 (14:49 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Tue, 20 Dec 2016 03:12:01 +0000 (11:12 +0800)
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>
BaseTools/Source/C/VfrCompile/Pccts/antlr/fset2.c
BaseTools/Source/C/VfrCompile/Pccts/antlr/gen.c
BaseTools/Source/C/VfrCompile/Pccts/antlr/lex.c

index 7f686a53d57158a8707df207bed466efc38d5059..fe1b4d624205e135efd10c228f5e02d1d002e983 100644 (file)
@@ -2210,7 +2210,7 @@ void MR_backTraceReport()
       if (p->ntype != nToken) continue;\r
       tn=(TokNode *)p;\r
       if (depth != 0) fprintf(stdout," ");\r
-      fprintf(stdout,TerminalString(tn->token));\r
+      fprintf(stdout, "%s", TerminalString(tn->token));\r
       depth++;\r
       if (! MR_AmbAidMultiple) {\r
         if (set_nil(tn->tset)) {\r
index 368a96b9ac8609f76c6c75cecf0c0b7403d42bbd..b99054534b8401f3ebb3a22dad638af5f3f1666f 100644 (file)
@@ -3866,7 +3866,7 @@ int file;
 /* MR10 */    _gen(" *  ");\r
 /* MR10 */    for (i=0 ; i < Save_argc ; i++) {\r
 /* MR10 */      _gen(" ");\r
-/* MR10 */      _gen(Save_argv[i]);\r
+/* MR10 */      _gen1("%s", Save_argv[i]);\r
 /* MR10 */    };\r
        _gen("\n");\r
        _gen(" *\n");\r
index 8c524fe465b9e84d17aa05c673d8700fff00ec33..a4e7f69b3665d34f1a2cd3b09654eb25d67ef2ea 100644 (file)
@@ -706,7 +706,7 @@ FILE *output;
 /* MR26 */                     if (! (isalpha(*t) || isdigit(*t) || *t == '_' || *t == '$')) break;\r
 /* MR26 */             }\r
 /* MR26 */     }\r
-/* MR26 */     fprintf(output,strBetween(pSymbol, t, pSeparator));\r
+/* MR26 */     fprintf(output, "%s", strBetween(pSymbol, t, pSeparator));\r
 \r
     *q = p;\r
     return (*pSeparator  == 0);\r
@@ -771,7 +771,7 @@ FILE *f;
                                  &pValue,\r
                                  &pSeparator,\r
                                  &nest);\r
-       fprintf(f,strBetween(pDataType, pSymbol, pSeparator));\r
+       fprintf(f, "%s", strBetween(pDataType, pSymbol, pSeparator));\r
 }\r
 \r
 /* check to see if string e is a word in string s */\r
@@ -852,9 +852,9 @@ int i;
                                          &pSeparator,\r
                                          &nest);\r
                fprintf(f,"\t");\r
-               fprintf(f,strBetween(pDataType, pSymbol, pSeparator));\r
+               fprintf(f, "%s", strBetween(pDataType, pSymbol, pSeparator));\r
                fprintf(f," ");\r
-               fprintf(f,strBetween(pSymbol, pEqualSign, pSeparator));\r
+               fprintf(f, "%s", strBetween(pSymbol, pEqualSign, pSeparator));\r
                fprintf(f,";\n");\r
     }\r
        fprintf(f,"};\n");\r