title: Android Kernel Compilation - error: missing braces around initializer [-Werror=missing-braces]
body: <p>I'm trying to compile my own custom kernel for Android using the toolchain from Android NDK r16b. I get the kernel source code at <a href="https://github.com/MiCode/Xiaomi_Kernel_OpenSource/tree/cactus-o-oss" rel="nofollow noreferrer">here</a>. I never modified the source code of the kernel (specifically that part). And this is the problem I had while compiling it.</p>
  <pre><code>/root/custom-kernel/kernel/Xiaomi_Kernel_OpenSource-cactus-o-oss/drivers/misc/mediatek/base/power/mcdi/mcdi_v1/mtk_mcdi_profile.c: In function 'mcdi_profile_read':
  /root/custom-kernel/kernel/Xiaomi_Kernel_OpenSource-cactus-o-oss/drivers/misc/mediatek/base/power/mcdi/mcdi_v1/mtk_mcdi_profile.c:239:2: error: missing braces around initializer [-Werror=missing-braces]
    } cnt[2] = {0};
    ^
  /root/custom-kernel/kernel/Xiaomi_Kernel_OpenSource-cactus-o-oss/drivers/misc/mediatek/base/power/mcdi/mcdi_v1/mtk_mcdi_profile.c:239:2: error: (near initialization for 'cnt[0].sec') [-Werror=missing-braces]
  cc1: all warnings being treated as errors
  </code></pre>
  <p><a href="http://paste.c-net.org/StudsExhibit" rel="nofollow noreferrer">This</a> is the part of the code that produces the error.
  If you want to see the full kernel compilation log,you can check it in <a href="http://paste.c-net.org/NickelsDances" rel="nofollow noreferrer">here</a>.
  This is the steps that i do for compiling the kernel :</p>
  <pre><code>export ARCH=arm
  export SUBARCH=arm
  export CROSS_COMPILE=/root/custom-kernel/kernel/toolchain/bin/arm-linux-androideabi-
  cd /root/custom-kernel/kernel/Xiaomi_Kernel_OpenSource-cactus-o-oss
  make clean
  make mrproper
  mkdir ../out
  make O=../out cereus_defconfig
  cd ../out
  make
  </code></pre>
  <p>I already try the solution from <a href="https://stackoverflow.com/questions/13746033/how-to-repair-warning-missing-braces-around-initializer">here</a> and it's still doesn't fix it.
  Any answer/help is appreciated!</p>