私はsysrepoライブラリhttps://github.com/sysrepo/sysrepoをtravis ciに依存してビルドしようとしており、ビットフィールドに問題があります。 14.04または16.04のubuntu VMにインストールしたときにこの問題が発生することはありません。トラvisciを使用するときになぜ表示されるのかがかなり混乱しています。すべてをインストールする私のビルドスクリプトは以下の通りです:ライブラリを構築しようとしていて、次の警告が表示されます。警告:ビットフィールドのタイプ 'type'はGCC拡張です。[-Wpedantic] uint8_t type:1;
#!/bin/bash
set -e
#this script installs sysrepo and all of its dependencies.
INSTALL_PREFIX_DIR=$HOME/local
export PKG_CONFIG_PATH=$INSTALL_PREFIX_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
export CC=gcc
sudo apt-get update -qq
sudo apt-get install -y cmake libev-dev libavl-dev
sudo apt-get install -y build-essential
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INSTALL_PREFIX_DIR/lib
GODIR=$PWD
cd $HOME
if [ ! -d "$INSTALL_PREFIX_DIR/lib" ]; then
# libyang
git clone https://github.com/CESNET/libyang.git
cd libyang ; mkdir build ; cd build
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX_DIR -DCMAKE_BUILD_TYPE=Debug -DENABLE_BUILD_TESTS=OFF ..
make -j2 && sudo make install
cd ../..
# protobuf
git clone https://github.com/google/protobuf.git
cd protobuf
./autogen.sh && ./configure --prefix=$INSTALL_PREFIX_DIR
sudo make -j2
sudo make install
cd ..
# protobuf-c
git clone https://github.com/protobuf-c/protobuf-c.git
cd protobuf-c
./autogen.sh && ./configure --prefix=$INSTALL_PREFIX_DIR
sudo make -j2
sudo make install
cd ..
else
echo "Using cached libraries from $INSTALL_PREFIX_DIR"
fi
echo "$INSTALL_PREFIX_DIR/lib" | sudo tee /etc/ld.so.conf.d/sysrepolibs.conf
sudo ldconfig
#sysrepo
git clone https://github.com/sysrepo/sysrepo.git
cd sysrepo
mkdir build ; cd build ;
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=$HOME/local ..
make
sudo make install
cd ../..
sudo ldconfig
#start sysrepo
sudo sysrepod -d -l4 &> sysrepod.log &
cd $GODIR
これはトラヴィスにbefore_scriptに呼び出され、私はこれらの警告を取得する以外、すべてが機能している:
[ 3%] Building C object src/CMakeFiles/COMMON.dir/common/sysrepo.pb-c.c.o
[ 5%] Building C object src/CMakeFiles/COMMON.dir/common/sr_common.c.o
In file included from /home/travis/local/include/libyang/libyang.h:20:0,
from /home/travis/sysrepo/src/common/sr_utils.h:36,
from /home/travis/sysrepo/src/common/sr_common.h:44,
from /home/travis/sysrepo/src/common/sr_common.c:28:
/home/travis/local/include/libyang/tree_schema.h:241:5: warning: type of bit-field ‘type’ is a GCC extension [-Wpedantic]
uint8_t type:1; /**< 0 - structure type used to distinguish structure from ::lys_submodule */
^
/home/travis/local/include/libyang/tree_schema.h:242:5: warning: type of bit-field ‘version’ is a GCC extension [-Wpedantic]
uint8_t version:4; /**< yang-version:
^
/home/travis/local/include/libyang/tree_schema.h:246:5: warning: type of bit-field ‘deviated’ is a GCC extension [-Wpedantic]
uint8_t deviated:2;
私はCプロジェクトをビルドするのエキスパートが、どの午前助けが大いに評価されるだろうか?
唯一の質問は、gccの拡張機能ですか? (意味がわからない場合は、このコードは別のコンパイラではコンパイルされません) – usr2564301
コードに '#include ' –
が不足している可能性があります。答えの左側に緑色のチェックマークが付きます)。これはコミュニティに質問が答えられたことを示し、あなたと回答者にいくつかの評判を与えます。 – 2501