hi,

I am trying to use libuci from a custom c++ package code and I am getting compilation error.

On including the uci.h, compiler is reporting errors at 3 places where uci_to_option cast is used. Here is one of them:

/home/gkl/hw_tip/openwrt/staging_dir/target-aarch64_armv8-a_glibc-2.19/usr/include/uci.h:679:10: error: cannot convert 'uci_element' to 'const int' in initialization
   return uci_to_option(e);
          ^
/home/gkl/hw_tip/openwrt/staging_dir/target-aarch64_armv8-a_glibc-2.19/usr/include/uci.h:679:10: error: expected ',' or ';' before '*' token
   return uci_to_option(e);
          ^
/home/gkl/hw_tip/openwrt/staging_dir/target-aarch64_armv8-a_glibc-2.19/usr/include/uci.h:679:10: error: '__mptr' was not declared in this scope
   return uci_to_option(e);
          ^
/home/gkl/hw_tip/openwrt/staging_dir/target-aarch64_armv8-a_glibc-2.19/usr/include/uci.h:679:10: error: void value not ignored as it ought to be
   return uci_to_option(e);

On commenting this usage, I can compile and use the functionlity.

I am using 15.05 openwrt and UCI version I am using is:

UCI_VERSION=2017-09-29
PKG_REV:=5ad59ad412a784c5c478e31d1701ce39568ffd58

This compilation is for ARM 64bit board and compiler is aarch64-openwrt-linux-gnu-g++ version 5.3.0.

My feeling is, this header file needs to modified to work in other environments as well  including mine. Any tips?

thanks,
gkl