title: Android native build error potentially insecure [-Werror,-Wformat-security]
body: <p>I am working on some Native android project with CMake. Where I am having an issue stating above error.</p>
  
  <p>I have created a method for logging from c files.</p>
  
  <pre><code>void log_android(int prio, const char *fmt, ...) {
      if (prio &gt;= loglevel) {
          char line[1024];
          va_list argptr;
          va_start(argptr, fmt);
          vsprintf(line, fmt, argptr);
          __android_log_print(prio, TAG, line);
          va_end(argptr);
      }
  }
  </code></pre>
  
  <p>While compiling this I am getting issue <code>String is not String literal</code> on <code>__android_log_print(prio, TAG, line);</code> near word <code>line</code>.</p>
  
  <p>It says its <code>potentially insecure [-Werror,-Wformat-security]</code>
  After doing some R&amp;D I found that I need to use certain cppFlags inside CMAKE 
  <code>APP_CFLAGS += -Wno-error=format-security</code>. But I am not certain where should I place this code inside my <code>CMakeLists.txt</code>.</p>
  
  <p>I tried to use these methods inside <code>CMakeLists.txt</code></p>
  
  <pre><code>set(compiler_c_flags "-Wno-error=format-security")
  set(compiler_cpp_flags "-Wno-error=format-security")
  </code></pre>
  
  <p>But no success please help.</p>