浏览代码

silence some clang warnings

ambrop7 13 年之前
父节点
当前提交
caa96cfbea
共有 4 个文件被更改,包括 4 次插入4 次删除
  1. 1 1
      CMakeLists.txt
  2. 1 1
      generated/NCDConfigParser_parse.c
  3. 1 1
      generated/NCDConfigParser_parse.y
  4. 1 1
      ncd/NCDConfigParser_parse.y

+ 1 - 1
CMakeLists.txt

@@ -107,7 +107,7 @@ if (NOT (SIZE_SIZE GREATER INT_SIZE OR SIZE_SIZE EQUAL INT_SIZE))
     message(FATAL_ERROR "size_t must be greater or equal than int")
 endif ()
 
-add_definitions(-std=gnu99 -Werror=implicit-function-declaration -Wno-unused-value -Wno-parentheses -Wno-switch-enum -Wredundant-decls)
+add_definitions(-std=gnu99 -Werror=implicit-function-declaration -Wno-unused-value -Wno-parentheses -Wno-switch-enum -Wno-switch -Wredundant-decls)
 
 # platform-specific stuff
 if (WIN32)

+ 1 - 1
generated/NCDConfigParser_parse.c

@@ -1444,7 +1444,7 @@ doneT:
 {
     ASSERT(yymsp[0].minor.yy0.str)
 
-    if (!NCDValue_InitStringBin(&yygotominor.yy43.v, yymsp[0].minor.yy0.str, yymsp[0].minor.yy0.len)) {
+    if (!NCDValue_InitStringBin(&yygotominor.yy43.v, (uint8_t *)yymsp[0].minor.yy0.str, yymsp[0].minor.yy0.len)) {
         goto failU0;
     }
 

+ 1 - 1
generated/NCDConfigParser_parse.y

@@ -578,7 +578,7 @@ map(R) ::= BRACKET_OPEN map_contents(A) BRACKET_CLOSE. {
 value(R) ::= STRING(A). {
     ASSERT(A.str)
 
-    if (!NCDValue_InitStringBin(&R.v, A.str, A.len)) {
+    if (!NCDValue_InitStringBin(&R.v, (uint8_t *)A.str, A.len)) {
         goto failU0;
     }
 

+ 1 - 1
ncd/NCDConfigParser_parse.y

@@ -578,7 +578,7 @@ map(R) ::= BRACKET_OPEN map_contents(A) BRACKET_CLOSE. {
 value(R) ::= STRING(A). {
     ASSERT(A.str)
 
-    if (!NCDValue_InitStringBin(&R.v, A.str, A.len)) {
+    if (!NCDValue_InitStringBin(&R.v, (uint8_t *)A.str, A.len)) {
         goto failU0;
     }