Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation for GCC 15 + start covering GCC 15 in CI (fixes #40) #42

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/full-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
- cc: gcc-14
clang_major_version: null
runs-on: ubuntu-24.04
- cc: gcc-15
clang_major_version: null
runs-on: ubuntu-24.04
- cc: clang-19
clang_major_version: 19
runs-on: ubuntu-22.04
Expand All @@ -22,6 +25,23 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: gcc_15_repo
if: "${{ matrix.cc == 'gcc-15' }}"
run: |
set -x
# The repository is at home at https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test .
# NOTE: plucky is 25.04 (not 24.04 LTS)
wget -O - 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xc8ec952e2a0e1fbdc5090f6a2c277a0a352154e5' | sudo apt-key add -
sudo add-apt-repository 'deb https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu plucky main'
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu/ plucky main'
- name: gcc_15_install
if: "${{ matrix.cc == 'gcc-15' }}"
run: |
set -x
sudo apt-get install --yes --no-install-recommends -V \
binutils \
gcc-15
apt-cache policy binutils
- name: clang_repo
if: "${{ contains(matrix.cc, 'clang') }}"
run: |
Expand Down
2 changes: 1 addition & 1 deletion src/argmatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# include <sys/types.h>

# ifndef PARAMS
# if PROTOTYPES || (defined (__STDC__) && __STDC__)
# if defined PROTOTYPES || (defined (__STDC__) && __STDC__)
# define PARAMS(args) args
# else
# define PARAMS(args) ()
Expand Down
2 changes: 1 addition & 1 deletion src/long-options.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ parse_long_options (int argc,
const char *package,
const char *version,
const char *authors,
void (*usage_func)())
void (*usage_func)(int))
{
int c;
int saved_opterr;
Expand Down
22 changes: 6 additions & 16 deletions src/md5.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "md5.h"

/* forward declaration */
static void Transform ();
static void Transform (UINT4 *buf, UINT4 *in);

static unsigned char PADDING[64] = {
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
Expand Down Expand Up @@ -80,8 +80,7 @@ static unsigned char PADDING[64] = {
(a) += (b); \
}

void MD5Init (mdContext)
MD5_CTX *mdContext;
void MD5Init (MD5_CTX *mdContext)
{
mdContext->i[0] = mdContext->i[1] = (UINT4)0;

Expand All @@ -93,10 +92,7 @@ MD5_CTX *mdContext;
mdContext->buf[3] = (UINT4)0x10325476;
}

void MD5Update (mdContext, inBuf, inLen)
MD5_CTX *mdContext;
const unsigned char *inBuf;
unsigned int inLen;
void MD5Update (MD5_CTX *mdContext, const unsigned char *inBuf, unsigned int inLen)
{
UINT4 in[16];
int mdi;
Expand Down Expand Up @@ -128,9 +124,7 @@ unsigned int inLen;
}
}

void MD5Final (mdContext, buf)
MD5_CTX *mdContext;
char *buf;
void MD5Final (MD5_CTX *mdContext, char *buf)
{
UINT4 in[16];
int mdi;
Expand Down Expand Up @@ -172,9 +166,7 @@ char *buf;

/* Print the context to the given buffer (32 digits)
*/
void MD5Sprint (mdContext, buf)
MD5_CTX *mdContext;
char *buf;
void MD5Sprint (MD5_CTX *mdContext, char *buf)
{
int i;

Expand All @@ -184,9 +176,7 @@ char *buf;

/* Basic MD5 step. Transform buf based on in.
*/
static void Transform (buf, in)
UINT4 *buf;
UINT4 *in;
static void Transform (UINT4 *buf, UINT4 *in)
{
UINT4 a = buf[0], b = buf[1], c = buf[2], d = buf[3];

Expand Down
4 changes: 2 additions & 2 deletions src/sys2.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ char *alloca ();
#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)

#ifndef PARAMS
# if PROTOTYPES
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
Expand Down Expand Up @@ -294,7 +294,7 @@ char *getlogin ();
#endif

#if !HAVE_DECL_TTYNAME
char *ttyname ();
char *ttyname (int fd);
#endif

#if !HAVE_DECL_GETEUID
Expand Down
12 changes: 0 additions & 12 deletions src/xstrtol.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,6 @@ extern int errno;

#include "xstrtol.h"

#ifndef strtol
long int strtol ();
#endif

#ifndef strtoul
unsigned long int strtoul ();
#endif

#ifndef strtoumax
uintmax_t strtoumax ();
#endif

static int
bkm_scale (__strtol_t *x, int scale_factor)
{
Expand Down