Skip to content

Commit

Permalink
*: fix warnings of compilation with gcc 5.4
Browse files Browse the repository at this point in the history
some warnings are removed by adding some tiny modifications in the code.
third party files are omitted in the warnings fix.
also there is a warning in travis when braces are put around fgets(){}
call, whereas the warning had disappeared with gcc 5.4. decision is to
keep gcc warning for this case, so that travis does not warn.

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Oct 15, 2019
1 parent 1b52b5c commit 4828e6c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
4 changes: 2 additions & 2 deletions rtrlib/transport/ssh/ssh_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ int tr_ssh_recv_async(const struct tr_ssh_socket *tr_ssh_sock, void *buf, const
return rtval;
}

int tr_ssh_recv(const void *tr_ssh_sock, void *buf, const size_t buf_len, const time_t timeout)
int tr_ssh_recv(const void *tr_ssh_sock, void *buf, const size_t buf_len,
const time_t timeout __attribute__((unused)))
{
ssh_channel rchans[2] = {((struct tr_ssh_socket *)tr_ssh_sock)->channel, NULL};

struct timeval timev = {1, 0};

if (ssh_channel_select(rchans, NULL, NULL, &timev) == SSH_EINTR)
Expand Down
6 changes: 4 additions & 2 deletions tests/test_dynamic_groups.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
const int connection_timeout = 20;
enum rtr_mgr_status connection_status = -1;

static void connection_status_callback(const struct rtr_mgr_group *group, enum rtr_mgr_status status,
const struct rtr_socket *socket, void *data)
static void connection_status_callback(const struct rtr_mgr_group *group __attribute__((unused)),
enum rtr_mgr_status status,
const struct rtr_socket *socket __attribute__((unused)),
void *data __attribute__((unused)))
{
connection_status = status;
}
Expand Down
16 changes: 9 additions & 7 deletions tests/test_live_validation.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
#include <string.h>
#include <unistd.h>

#define RPKI_CACHE_HOST "rpki-validator.realmv6.org"
#define RPKI_CACHE_POST "8283"

struct test_validity_query {
char *pfx;
const char *pfx;
int len;
int asn;
int val;
unsigned int val;
};

static char *RPKI_CACHE_HOST = "rpki-validator.realmv6.org";
static char *RPKI_CACHE_POST = "8283";

/*
* Verification is based on ROAs for RIPE RIS Routing Beacons, see:
* (https://www.ripe.net/analyse/internet-measurements/
Expand All @@ -40,8 +40,10 @@ const struct test_validity_query queries[] = {{"93.175.146.0", 24, 12654, BGP_PF
const int connection_timeout = 20;
enum rtr_mgr_status connection_status = -1;

static void connection_status_callback(const struct rtr_mgr_group *group, enum rtr_mgr_status status,
const struct rtr_socket *socket, void *data)
static void connection_status_callback(const struct rtr_mgr_group *group __attribute__((unused)),
enum rtr_mgr_status status,
const struct rtr_socket *socket __attribute__((unused)),
void *data __attribute__((unused)))
{
if (status == RTR_MGR_ERROR)
connection_status = status;
Expand Down
6 changes: 4 additions & 2 deletions tools/rpki-rov.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
const int connection_timeout = 20;
enum rtr_mgr_status connection_status = -1;

static void connection_status_callback(const struct rtr_mgr_group *group, enum rtr_mgr_status status,
const struct rtr_socket *socket, void *data)
static void connection_status_callback(const struct rtr_mgr_group *group __attribute__((unused)),
enum rtr_mgr_status status,
const struct rtr_socket *socket __attribute__((unused)),
void *data __attribute__((unused)))
{
if (status == RTR_MGR_ERROR)
connection_status = status;
Expand Down

0 comments on commit 4828e6c

Please sign in to comment.