Merge pull request #607 from mrdeep1/ubuntu_20_4

Ubuntu 20.4: Fix builds as Ubuntu 20.4 will be used by github workflows
This commit is contained in:
obgm authored and GitHub committed 2021-03-01 18:26:16 +01:00
commit b1ababec35
6 files changed
+43 -27

No files matched your search

+18 -11
View File
@@ -25,8 +25,6 @@ jobs:
TLS: ["no", "openssl", "gnutls", "mbedtls"]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libcunit1-dev libmbedtls-dev libgnutls28-dev libtool libtool-bin exuberant-ctags valgrind
@@ -36,13 +34,13 @@ jobs:
run: |
mkdir build-${{matrix.TLS}}-${{matrix.CC}}
cd build-${{matrix.TLS}}-${{matrix.CC}}
$GITHUB_WORKSPACE/configure --disable-documentation --enable-examples --enable-tests --disable-dtls CC=${{matrix.CC}}
$GITHUB_WORKSPACE/configure --disable-silent-rules --disable-documentation --enable-examples --enable-tests --disable-dtls CC=${{matrix.CC}}
- name: configure TLS
if: matrix.TLS != 'no'
run: |
mkdir build-${{matrix.TLS}}-${{matrix.CC}}
cd build-${{matrix.TLS}}-${{matrix.CC}}
"$GITHUB_WORKSPACE/configure" --disable-documentation --enable-examples --enable-tests --with-${{matrix.TLS}} CC=${{matrix.CC}}
"$GITHUB_WORKSPACE/configure" --disable-silent-rules --disable-documentation --enable-examples --enable-tests --with-${{matrix.TLS}} CC=${{matrix.CC}}
- name: compile
run: |
cd build-${{matrix.TLS}}-${{matrix.CC}}
@@ -63,7 +61,7 @@ jobs:
./autogen.sh
- name: configure
run: |
$GITHUB_WORKSPACE/configure --disable-documentation --enable-examples --enable-tests --with-tinydtls
$GITHUB_WORKSPACE/configure --disable-silent-rules --disable-documentation --enable-examples --enable-tests --with-tinydtls
- name: compile
run: |
make EXTRA_CFLAGS=-Werror && make check EXTRA_CFLAGS=-Werror
@@ -72,21 +70,30 @@ jobs:
LD_LIBRARY_PATH=ext/tinydtls libtool --mode=execute valgrind --track-origins=yes --leak-check=yes --show-reachable=yes --error-exitcode=123 --quiet --suppressions=$GITHUB_WORKSPACE/tests/valgrind_suppression tests/testdriver
cmake-build:
runs-on: ubuntu-latest
strategy:
matrix:
TLS: ["no", "openssl", "gnutls", "mbedtls", "tinydtls"]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libcunit1-dev libgnutls28-dev
cmake -E make_directory $GITHUB_WORKSPACE}/build
- name: configure
sudo apt-get update && sudo apt-get install -y libcunit1-dev libmbedtls-dev libgnutls28-dev
cmake -E make_directory $GITHUB_WORKSPACE}/build-${{matrix.TLS}}-cmake
- name: configure no-TLS
if: matrix.TLS == 'no'
run: |
cd $GITHUB_WORKSPACE}/build
cmake $GITHUB_WORKSPACE -DENABLE_EXAMPLES=ON -DENABLE_TESTS=ON -DENABLE_DTLS=ON -DDTLS_BACKEND=gnutls
cd $GITHUB_WORKSPACE}/build-${{matrix.TLS}}-cmake
cmake $GITHUB_WORKSPACE -DENABLE_EXAMPLES=ON -DENABLE_TESTS=ON -DENABLE_DTLS=OFF -DENABLE_DOCS=OFF
- name: configure TLS
if: matrix.TLS != 'no'
run: |
cd $GITHUB_WORKSPACE}/build-${{matrix.TLS}}-cmake
cmake $GITHUB_WORKSPACE -DENABLE_EXAMPLES=ON -DENABLE_TESTS=ON -DENABLE_DTLS=ON -DENABLE_DOCS=OFF -DDTLS_BACKEND=${{matrix.TLS}}
- name: build
run: |
cd $GITHUB_WORKSPACE}/build
cd $GITHUB_WORKSPACE}/build-${{matrix.TLS}}-cmake
cmake --build .
other-build:
runs-on: ubuntu-latest
+1
View File
@@ -399,6 +399,7 @@ target_sources(
${CMAKE_CURRENT_LIST_DIR}/src/option.c
${CMAKE_CURRENT_LIST_DIR}/src/async.c
${CMAKE_CURRENT_LIST_DIR}/src/block.c
${CMAKE_CURRENT_LIST_DIR}/src/coap_asn1.c
${CMAKE_CURRENT_LIST_DIR}/src/coap_cache.c
${CMAKE_CURRENT_LIST_DIR}/src/coap_debug.c
${CMAKE_CURRENT_LIST_DIR}/src/coap_event.c
+1 -1
View File
@@ -41,7 +41,7 @@ vpath %.c $(top_srcdir)/src
COAPOBJS = net.o coap_cache.o coap_debug.o option.o resource.o pdu.o encode.o subscribe.o coap_io_lwip.o block.o uri.o str.o coap_session.o coap_notls.o coap_hashkey.o address.o coap_tcp.o async.o
CFLAGS += -g3 -Wall -Wextra -pedantic -O0 -fpack-struct
CFLAGS += -g3 -Wall -Wextra -pedantic -O0
# not sorted out yet
CFLAGS += -Wno-unused-parameter
+20 -1
View File
@@ -27,6 +27,25 @@
#define UNUSED_PARAM
#endif /* GCC */
#define Nn 8 /* duplicate definition of N if built on sky motes */
#define ENCODE_HEADER_SIZE 4
#define HIBIT (1 << (Nn - 1))
#define EMASK ((1 << ENCODE_HEADER_SIZE) - 1)
#define MMASK ((1 << Nn) - 1 - EMASK)
#define MAX_VALUE ( (1 << Nn) - (1 << ENCODE_HEADER_SIZE) ) * (1 << ((1 << ENCODE_HEADER_SIZE) - 1))
#define COAP_PSEUDOFP_DECODE_8_4(r) (r < HIBIT ? r : (r & MMASK) << (r & EMASK))
/* ls and s must be integer variables */
/* #define COAP_PSEUDOFP_ENCODE_8_4_DOWN(v,ls) (v < HIBIT ? v : (ls = coap_fls(v) - Nn, (v >> ls) & MMASK) + ls) */
COAP_STATIC_INLINE unsigned char
COAP_PSEUDOFP_ENCODE_8_4_DOWN(unsigned int v, int *ls) {
if (v < HIBIT) return v;
*ls = coap_fls(v) - Nn;
return ((v >> *ls) & MMASK) + *ls;
}
#define COAP_PSEUDOFP_ENCODE_8_4_UP(v,ls,s) (v < HIBIT ? v : (ls = coap_fls(v) - Nn, (s = (((v + ((1<<ENCODE_HEADER_SIZE<<ls)-1)) >> ls) & MMASK)), s == 0 ? HIBIT + ls + 1 : s + ls))
static coap_tid_t id;
static int quit = 0;
@@ -50,7 +69,7 @@ make_pdu( unsigned int value ) {
pdu->code = COAP_REQUEST_POST;
pdu->tid = id++;
enc = COAP_PSEUDOFP_ENCODE_8_4_DOWN(value,ls);
enc = COAP_PSEUDOFP_ENCODE_8_4_DOWN(value, &ls);
len = sprintf((char *)buf, "%c%u", enc, COAP_PSEUDOFP_DECODE_8_4(enc));
coap_add_data( pdu, len, buf );
-13
View File
@@ -18,15 +18,6 @@
#include <stdint.h>
#define Nn 8 /* duplicate definition of N if built on sky motes */
#define ENCODE_HEADER_SIZE 4
#define HIBIT (1 << (Nn - 1))
#define EMASK ((1 << ENCODE_HEADER_SIZE) - 1)
#define MMASK ((1 << Nn) - 1 - EMASK)
#define MAX_VALUE ( (1 << Nn) - (1 << ENCODE_HEADER_SIZE) ) * (1 << ((1 << ENCODE_HEADER_SIZE) - 1))
#define COAP_PSEUDOFP_DECODE_8_4(r) (r < HIBIT ? r : (r & MMASK) << (r & EMASK))
#ifndef HAVE_FLS
/* include this only if fls() is not available */
extern int coap_fls(unsigned int i);
@@ -41,10 +32,6 @@ extern int coap_flsll(long long i);
#define coap_flsll(i) flsll(i)
#endif
/* ls and s must be integer variables */
#define COAP_PSEUDOFP_ENCODE_8_4_DOWN(v,ls) (v < HIBIT ? v : (ls = coap_fls(v) - Nn, (v >> ls) & MMASK) + ls)
#define COAP_PSEUDOFP_ENCODE_8_4_UP(v,ls,s) (v < HIBIT ? v : (ls = coap_fls(v) - Nn, (s = (((v + ((1<<ENCODE_HEADER_SIZE<<ls)-1)) >> ls) & MMASK)), s == 0 ? HIBIT + ls + 1 : s + ls))
/**
* @defgroup encode Encode / Decode API
* API functions for endoding/decoding CoAP options.
+3 -1
View File
@@ -43,6 +43,8 @@
-Wunused \
-Wwrite-strings \
-Wno-unused-function \
-Wno-unused-but-set-variable \
-Werror \
"
#endif /* ! _WIN32 */
@@ -137,7 +139,7 @@ int main(int argc, char* argv[])
if (in_synopsis) {
/* Working in SYNOPSIS section */
size_t len;
char outbuf[512];
char outbuf[1024];
char *cp;
char *ecp;