Skip to content

Commit a7745c7

Browse files
GitHub CI Workflow: Bump OS and compiler versions (#447)
* GitHub CI Workflow: Bump OS and compiler versions * CI: fix for clang 18/19 - Don't enable -Werror during the execution of ./configure and drop -Wunused-value from --enable-warnings - librb/src/crypt.c: remove old-style function decls - rb_dictionary: define type of arguments, fix callees - rb_radixtree: fix spurious out-of-bounds diagnostic Co-authored-by: Doug Freed <[email protected]>
1 parent c3649db commit a7745c7

File tree

10 files changed

+66
-64
lines changed

10 files changed

+66
-64
lines changed

.github/workflows/ci.yml

+25-18
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ name: CI
22

33
on:
44
push:
5-
branches:
5+
branches:
66
- main
77
paths-ignore:
8+
- '.github/workflows/docs.yaml'
89
- 'doc/oper-guide/**'
910
- 'CREDITS'
1011
- 'LICENSE'
@@ -14,6 +15,7 @@ on:
1415
branches:
1516
- main
1617
paths-ignore:
18+
- '.github/workflows/docs.yaml'
1719
- 'doc/oper-guide/**'
1820
- 'CREDITS'
1921
- 'LICENSE'
@@ -23,39 +25,40 @@ on:
2325
jobs:
2426
linux:
2527
name: Linux
26-
2728
runs-on: ${{ matrix.os }}
28-
2929
strategy:
3030
fail-fast: false
3131
matrix:
3232
include:
33-
# Debian 10 Buster
34-
- os: ubuntu-20.04
35-
compiler: gcc-8
36-
- os: ubuntu-20.04
37-
compiler: clang-7
38-
# Ubuntu 20.04 Focal
39-
- os: ubuntu-20.04
40-
compiler: gcc-9
41-
- os: ubuntu-20.04
42-
compiler: clang-10
4333
# Debian 11 Bullseye
4434
- os: ubuntu-22.04
4535
compiler: gcc-10
4636
- os: ubuntu-22.04
4737
compiler: clang-11
38+
# Debian 12 Bookworm
39+
- os: ubuntu-24.04
40+
compiler: gcc-12
41+
- os: ubuntu-24.04
42+
compiler: clang-14
43+
# Debian 13 Trixie
44+
- os: ubuntu-24.04
45+
compiler: gcc-14
46+
- os: ubuntu-24.04
47+
compiler: clang-19
4848
# Ubuntu 22.04 Jammy
4949
- os: ubuntu-22.04
5050
compiler: gcc-11
5151
- os: ubuntu-22.04
5252
compiler: clang-14
53-
# next
54-
- os: ubuntu-22.04
55-
compiler: gcc-12
53+
# Ubuntu 24.04 Noble
54+
- os: ubuntu-24.04
55+
compiler: gcc-13
56+
- os: ubuntu-24.04
57+
compiler: clang-18
5658

5759
env:
5860
CC: ${{ matrix.compiler }}
61+
RUNNING_IN_CI: yes
5962

6063
steps:
6164
- name: Install dependencies
@@ -66,14 +69,18 @@ jobs:
6669
automake \
6770
autoconf \
6871
libtool \
72+
libltdl-dev \
6973
libsqlite3-dev \
7074
libhyperscan-dev \
7175
# EOF
72-
- uses: actions/checkout@v2
76+
- uses: actions/checkout@main
77+
with:
78+
persist-credentials: false
79+
submodules: recursive
7380
- name: autogen.sh
7481
run: bash autogen.sh
7582
- name: configure
76-
run: CFLAGS="-Werror -Wno-unused-value -Wno-unused-parameter" ./configure --enable-assert=hard --enable-warnings
83+
run: ./configure --enable-assert=hard --enable-warnings
7784
- name: make
7885
run: make -j2
7986
- name: make check

configure.ac

+6-1
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ SOLANUM_C_GCC_TRY_FLAGS([-Wmissing-noreturn], solanum_cv_c_gcc_w_missing_noretur
588588
SOLANUM_C_GCC_TRY_FLAGS([-Wundef], solanum_cv_c_gcc_w_undef)
589589
SOLANUM_C_GCC_TRY_FLAGS([-Wpacked], solanum_cv_c_gcc_w_packed)
590590
SOLANUM_C_GCC_TRY_FLAGS([-Wnested-externs], solanum_cv_c_gcc_w_nested_externs)
591-
SOLANUM_C_GCC_TRY_FLAGS([-Wunused-function -Wunused-label -Wunused-value -Wunused-variable], solanum_cv_c_gcc_w_unused)
591+
SOLANUM_C_GCC_TRY_FLAGS([-Wunused-function -Wunused-label -Wunused-variable], solanum_cv_c_gcc_w_unused)
592592
SOLANUM_C_GCC_TRY_FLAGS([-Wredundant-decls], solanum_cv_c_gcc_w_redundant_decls)
593593
SOLANUM_C_GCC_TRY_FLAGS([-Wfloat-equal], solanum_cv_c_gcc_w_float_equal)
594594
SOLANUM_C_GCC_TRY_FLAGS([-Wformat -Wformat-y2k -Wno-format-security], solanum_cv_c_gcc_w_format)
@@ -619,6 +619,11 @@ else
619619
AC_DEFINE_UNQUOTED(IRCD_PREFIX, "$prefix", [Prefix where the ircd is installed.])
620620
fi
621621

622+
if test "x${RUNNING_IN_CI}" = "xyes"; then
623+
IRC_CFLAGS="${IRC_CFLAGS} -Werror -Wno-unused-value -Wno-unused-parameter"
624+
AC_SUBST(IRC_CFLAGS)
625+
fi
626+
622627
AC_CONFIG_FILES( \
623628
Makefile \
624629
authd/Makefile \

include/match.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ bool matches_mask(const struct matchset *m, const char *mask);
7373
/*
7474
* irccmp - case insensitive comparison of s1 and s2
7575
*/
76-
extern int irccmp(const char *s1, const char *s2);
76+
extern int irccmp(const void *s1, const void *s2);
7777
/*
7878
* ircncmp - counted case insensitive comparison of s1 and s2
7979
*/
80-
extern int ircncmp(const char *s1, const char *s2, int n);
80+
extern int ircncmp(const void *s1, const void *s2, int n);
8181
/*
8282
** canonize - reduce a string of duplicate list entries to contain
8383
** only the unique items.

ircd/match.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ char *collapse_esc(char *pattern)
583583
* <0, if s1 lexicographically less than s2
584584
* >0, if s1 lexicographically greater than s2
585585
*/
586-
int irccmp(const char *s1, const char *s2)
586+
int irccmp(const void *s1, const void *s2)
587587
{
588588
const unsigned char *str1 = (const unsigned char *)s1;
589589
const unsigned char *str2 = (const unsigned char *)s2;
@@ -602,7 +602,7 @@ int irccmp(const char *s1, const char *s2)
602602
return (res);
603603
}
604604

605-
int ircncmp(const char *s1, const char *s2, int n)
605+
int ircncmp(const void *s1, const void *s2, int n)
606606
{
607607
const unsigned char *str1 = (const unsigned char *)s1;
608608
const unsigned char *str2 = (const unsigned char *)s2;

librb/include/rb_dictionary.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ typedef struct rb_dictionary_iter rb_dictionary_iter;
3333

3434
struct rb_dictionary;
3535

36-
typedef int (*DCF)(/* const void *a, const void *b */);
36+
typedef int (*DCF)(const void *a, const void *b);
3737

3838
struct rb_dictionary_element
3939
{

librb/include/rb_tools.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
#ifndef __TOOLS_H__
3131
#define __TOOLS_H__
3232

33-
int rb_strcasecmp(const char *s1, const char *s2);
34-
int rb_strncasecmp(const char *s1, const char *s2, size_t n);
33+
int rb_strcasecmp(const void *s1, const void *s2);
34+
int rb_strncasecmp(const void *s1, const void *s2, size_t n);
3535
char *rb_strcasestr(const char *s, const char *find);
3636
size_t rb_strlcpy(char *dst, const char *src, size_t siz);
3737
size_t rb_strlcat(char *dst, const char *src, size_t siz);

librb/src/crypt.c

+5-14
Original file line numberDiff line numberDiff line change
@@ -846,8 +846,7 @@ static unsigned char PADDING[64] = {
846846
/* MD5 initialization. Begins an MD5 operation, writing a new context. */
847847

848848
static void
849-
MD5Init (context)
850-
MD5_CTX *context;
849+
MD5Init (MD5_CTX *context)
851850
{
852851

853852
context->count[0] = context->count[1] = 0;
@@ -866,10 +865,7 @@ MD5Init (context)
866865
*/
867866

868867
static void
869-
MD5Update (context, in, inputLen)
870-
MD5_CTX *context;
871-
const void *in;
872-
unsigned int inputLen;
868+
MD5Update (MD5_CTX *context, const void *in, unsigned int inputLen)
873869
{
874870
unsigned int i, idx, partLen;
875871
const unsigned char *input = in;
@@ -909,8 +905,7 @@ MD5Update (context, in, inputLen)
909905
*/
910906

911907
static void
912-
MD5Pad (context)
913-
MD5_CTX *context;
908+
MD5Pad (MD5_CTX *context)
914909
{
915910
unsigned char bits[8];
916911
unsigned int idx, padLen;
@@ -933,9 +928,7 @@ MD5Pad (context)
933928
*/
934929

935930
static void
936-
MD5Final (digest, context)
937-
unsigned char digest[16];
938-
MD5_CTX *context;
931+
MD5Final (unsigned char digest[16], MD5_CTX *context)
939932
{
940933
/* Do padding. */
941934
MD5Pad (context);
@@ -950,9 +943,7 @@ MD5Final (digest, context)
950943
/* MD5 basic transformation. Transforms state based on block. */
951944

952945
static void
953-
MD5Transform (state, block)
954-
uint32_t state[4];
955-
const unsigned char block[64];
946+
MD5Transform (uint32_t state[4], const unsigned char block[64])
956947
{
957948
uint32_t a = state[0], b = state[1], c = state[2], d = state[3], x[16];
958949

librb/src/radixtree.c

+20-21
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,7 @@ rb_radixtree_elem_add(rb_radixtree *dict, const char *key, void *data)
673673
char *ckey;
674674

675675
rb_radixtree_elem *delem, *prev, *newnode;
676-
677-
rb_radixtree_elem **place1;
676+
rb_radixtree_leaf *leaf;
678677

679678
int val, keylen;
680679
int i, j;
@@ -723,16 +722,16 @@ rb_radixtree_elem_add(rb_radixtree *dict, const char *key, void *data)
723722
{
724723
lrb_assert(prev == NULL);
725724
lrb_assert(dict->count == 0);
726-
place1 = &dict->root;
727-
*place1 = rb_malloc(sizeof(rb_radixtree_leaf));
728-
lrb_assert(*place1 != NULL);
729-
(*place1)->nibnum = -1;
730-
(*place1)->leaf.data = data;
731-
(*place1)->leaf.key = ckey;
732-
(*place1)->leaf.parent = prev;
733-
(*place1)->leaf.parent_val = val;
725+
leaf = rb_malloc(sizeof(rb_radixtree_leaf));
726+
lrb_assert(leaf != NULL);
727+
leaf->nibnum = -1;
728+
leaf->data = data;
729+
leaf->key = ckey;
730+
leaf->parent = prev;
731+
leaf->parent_val = val;
732+
dict->root = (rb_radixtree_elem *) leaf;
734733
dict->count++;
735-
return &(*place1)->leaf;
734+
return leaf;
736735
}
737736

738737
/* Find the first nibble where they differ. */
@@ -802,17 +801,17 @@ rb_radixtree_elem_add(rb_radixtree *dict, const char *key, void *data)
802801
}
803802

804803
val = NIBBLE_VAL(ckey, i);
805-
place1 = &newnode->node.down[val];
806-
lrb_assert(*place1 == NULL);
807-
*place1 = rb_malloc(sizeof(rb_radixtree_leaf));
808-
lrb_assert(*place1 != NULL);
809-
(*place1)->nibnum = -1;
810-
(*place1)->leaf.data = data;
811-
(*place1)->leaf.key = ckey;
812-
(*place1)->leaf.parent = newnode;
813-
(*place1)->leaf.parent_val = val;
804+
lrb_assert(newnode->node.down[val] == NULL);
805+
leaf = rb_malloc(sizeof(rb_radixtree_leaf));
806+
lrb_assert(leaf != NULL);
807+
leaf->nibnum = -1;
808+
leaf->data = data;
809+
leaf->key = ckey;
810+
leaf->parent = newnode;
811+
leaf->parent_val = val;
812+
newnode->node.down[val] = (rb_radixtree_elem *) leaf;
814813
dict->count++;
815-
return &(*place1)->leaf;
814+
return leaf;
816815
}
817816

818817
int

librb/src/tools.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ rb_string_to_array(char *string, char **parv, int maxpara)
134134
}
135135

136136
int
137-
rb_strcasecmp(const char *s1, const char *s2)
137+
rb_strcasecmp(const void *s1, const void *s2)
138138
{
139139
return strcasecmp(s1, s2);
140140
}
141141

142142
int
143-
rb_strncasecmp(const char *s1, const char *s2, size_t n)
143+
rb_strncasecmp(const void *s1, const void *s2, size_t n)
144144
{
145145
return strncasecmp(s1, s2, n);
146146
}

tests/rb_dictionary1.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
static void replace1(void)
3535
{
36-
rb_dictionary *dict = rb_dictionary_create("replace1", strcmp);
36+
rb_dictionary *dict = rb_dictionary_create("replace1", rb_strcasecmp);
3737
rb_dictionary_element *original = rb_dictionary_add(dict, "test", "data1");
3838

3939
ok(original != NULL, MSG);

0 commit comments

Comments
 (0)