Skip to content

Commit bc5e25f

Browse files
authored
Merge pull request #37 from calebccff/werror-and-alpine
Add Alpine Linux CI and stop enabling werror for everyone
2 parents bd5c609 + 67f2d38 commit bc5e25f

File tree

5 files changed

+37
-7
lines changed

5 files changed

+37
-7
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
family: [x86-64]
3333
compiler: [gcc, clang]
3434
container:
35+
- alpine:edge
36+
- alpine:latest
3537
- archlinux:latest
3638
- debian:testing
3739
- debian:stable
@@ -208,7 +210,7 @@ jobs:
208210
if: ${{ matrix.variant == 'i386' }}
209211
run: |
210212
mkdir build
211-
CFLAGS="-m32" LDFLAGS="-m32" meson setup . build
213+
CFLAGS="-m32" LDFLAGS="-m32" meson setup --errorlogs --werror . build
212214
213215
- name: Meson init with cross compile
214216
if: ${{ matrix.variant == 'cross-compile' }}
@@ -228,13 +230,13 @@ jobs:
228230
echo "pkg_config_libdir = '${PKG_CONFIG_PATH}'" >> cross.txt
229231
cat cross.txt
230232
mkdir build
231-
meson setup --cross-file cross.txt . build
233+
meson setup --errorlogs --werror --cross-file cross.txt . build
232234
233235
- name: Meson init
234236
if: ${{ matrix.variant == '' }}
235237
run: |
236238
mkdir build
237-
meson setup . build
239+
meson setup --errorlogs --werror . build
238240
239241
- name: Compile
240242
run: ninja -C build

cdba-server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void cdba_send_buf(int type, size_t len, const void *buf)
158158

159159
static int handle_stdin(int fd, void *buf)
160160
{
161-
static struct circ_buf recv_buf = { 0 };
161+
static struct circ_buf recv_buf = { };
162162
struct msg *msg;
163163
struct msg hdr;
164164
size_t n;

cdba.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ int main(int argc, char **argv)
581581
int timeout_total = 600;
582582
struct work *next;
583583
struct work *work;
584-
struct circ_buf recv_buf = { 0 };
584+
struct circ_buf recv_buf = { };
585585
const char *board = NULL;
586586
const char *host = NULL;
587587
struct timeval now;

ci/alpine.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
# SPDX-License-Identifier: GPL-2.0
3+
#
4+
# Copyright (c) 2021 Canonical Ltd.
5+
# Copyright (c) 2023 Linaro Ltd
6+
# Author: Krzysztof Kozlowski <[email protected]>
7+
8+
#
9+
10+
set -ex
11+
12+
PKGS_CC="gcc"
13+
case $CC in
14+
clang*)
15+
PKGS_CC="clang"
16+
;;
17+
esac
18+
19+
apk add \
20+
linux-headers \
21+
libftdi1-dev \
22+
yaml-dev \
23+
eudev-dev \
24+
meson \
25+
musl-dev \
26+
libc-dev \
27+
$PKGS_CC
28+
29+
echo "Install finished: $0"

meson.build

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ compiler_cflags = ['-Wno-unused-parameter',
2626

2727
# TODO add clang specific options
2828
if compiler.get_id() == 'gcc'
29-
compiler_cflags += ['-Werror', # Only set it on GCC
30-
'-Wformat-signedness',
29+
compiler_cflags += ['-Wformat-signedness',
3130
'-Wduplicated-cond',
3231
'-Wduplicated-branches',
3332
'-Wvla-larger-than=1',

0 commit comments

Comments
 (0)