summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoryangwei <[email protected]>2024-07-24 16:25:24 +0800
committeryangwei <[email protected]>2024-07-24 17:03:50 +0800
commit50d6bb803bba127d1397aa6d54cfac3f445de5ab (patch)
tree9825f83dd94acf371f16877a5b8a00972e51b28f /src
parent4a00ae6dea92e1600a5fb057d4b6d902effac478 (diff)
🔧 build(cmake): add UndefinedBehaviorSanitizer
Diffstat (limited to 'src')
-rw-r--r--src/stellar_on_sapp/stellar_on_sapp_api.c7
-rw-r--r--src/stellar_on_sapp/stellar_on_sapp_loader.c19
2 files changed, 14 insertions, 12 deletions
diff --git a/src/stellar_on_sapp/stellar_on_sapp_api.c b/src/stellar_on_sapp/stellar_on_sapp_api.c
index 7459c54..20f87a6 100644
--- a/src/stellar_on_sapp/stellar_on_sapp_api.c
+++ b/src/stellar_on_sapp/stellar_on_sapp_api.c
@@ -224,15 +224,18 @@ inline int polling_on_sapp(struct stellar *st)
* STELLAR INFO INTERFACE WRAPPER ON SAPP
*********************************************/
-int stellar_get_worker_thread_num(struct stellar *st __attribute__((unused)))
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-parameter"
+int stellar_get_worker_thread_num(struct stellar *st)
{
return get_thread_count();
}
-int stellar_get_current_thread_id(struct stellar *st __attribute__((unused)))
+int stellar_get_current_thread_id(struct stellar *st)
{
return get_current_worker_thread_id();
}
+#pragma GCC diagnostic pop
/*********************************************
* PACKET INFO INTERFACE WRAPPER ON SAPP*
diff --git a/src/stellar_on_sapp/stellar_on_sapp_loader.c b/src/stellar_on_sapp/stellar_on_sapp_loader.c
index a729e31..1497093 100644
--- a/src/stellar_on_sapp/stellar_on_sapp_loader.c
+++ b/src/stellar_on_sapp/stellar_on_sapp_loader.c
@@ -1,11 +1,10 @@
+#pragma GCC diagnostic ignored "-Wunused-parameter"
+
#include "stellar/stellar.h"
#include "stellar/session_exdata.h"
-
#include "stellar_on_sapp.h"
-
#include <MESA/stream.h>
-
#define STELLAR_PLUGIN_PATH "./stellar_plugin/spec.toml"
#define STELLAR_BRIDEGE_NAME "STELLAR_SESSION"
#define STELLAR_EXDATA_NAME "SAPP_STREAMINFO"
@@ -35,7 +34,7 @@ static int stream_is_inner_most(struct streaminfo *a_stream)
}
-static void stellar_on_sapp_bridge_free(const struct streaminfo *stream __attribute__((unused)), int bridge_id __attribute__((unused)), void *data)
+static void stellar_on_sapp_bridge_free(const struct streaminfo *stream , int bridge_id , void *data)
{
session_free_on_sapp((struct session *)data);
return;
@@ -64,7 +63,7 @@ int STELLAR_DEFER_LOADER_INIT()
return 0;
}
-char stellar_on_sapp_defer_entry(struct streaminfo *pstream,void **pme __attribute__((unused)), int thread_seq __attribute__((unused)),void *a_packet __attribute__((unused)))
+char stellar_on_sapp_defer_entry(struct streaminfo *pstream,void **pme , int thread_seq ,void *a_packet )
{
if(pstream->pktstate==OP_STATE_PENDING && stream_is_inner_most(pstream)==0)
{
@@ -84,7 +83,7 @@ void STELLAR_DEFER_LOADER_EXIT(void)
}
-static int is_ctrl_packet(struct streaminfo *pstream __attribute__((unused)), const void *raw_pkt)
+static int is_ctrl_packet(struct streaminfo *pstream , const void *raw_pkt)
{
int is_ctrl_pkt=0;
if(raw_pkt)
@@ -94,7 +93,7 @@ static int is_ctrl_packet(struct streaminfo *pstream __attribute__((unused)), co
return is_ctrl_pkt;
}
-static unsigned char loader_transfer_stream_entry(struct streaminfo *pstream, UCHAR state, void **pme __attribute__((unused)), int thread_seq __attribute__((unused)),void *a_packet, enum entry_type type)
+static unsigned char loader_transfer_stream_entry(struct streaminfo *pstream, UCHAR state, void **pme , int thread_seq ,void *a_packet, enum entry_type type)
{
unsigned char entry_ret=APP_STATE_GIVEME;
if(state == OP_STATE_PENDING && (stream_is_inner_most(pstream)==0))
@@ -173,19 +172,19 @@ unsigned char stellar_on_sapp_tcp_entry(struct streaminfo *pstream,void **pme, i
return loader_transfer_stream_entry(pstream, pstream->opstate, pme, thread_seq, a_packet, ENTRY_TYPE_TCP);
}
-char stellar_on_sapp_ip4_entry( struct streaminfo *pstream,unsigned char routedir __attribute__((unused)),int thread_seq __attribute__((unused)), void *a_packet)
+char stellar_on_sapp_ip4_entry( struct streaminfo *pstream,unsigned char routedir ,int thread_seq , void *a_packet)
{
if(stream_is_inner_most(pstream)==1)packet_update_on_sapp(g_stellar, pstream, a_packet, IPv4);
return APP_STATE_GIVEME;
}
-char stellar_on_sapp_ip6_entry( struct streaminfo *pstream,unsigned char routedir __attribute__((unused)),int thread_seq __attribute__((unused)), void *a_packet)
+char stellar_on_sapp_ip6_entry( struct streaminfo *pstream,unsigned char routedir ,int thread_seq , void *a_packet)
{
if(stream_is_inner_most(pstream)==1)packet_update_on_sapp(g_stellar, pstream, a_packet, IPv6);
return APP_STATE_GIVEME;
}
-char stellar_on_sapp_polling_entry(struct streaminfo *stream __attribute__((unused)), void **pme __attribute__((unused)), int thread_seq __attribute__((unused)),void *a_packet __attribute__((unused)))
+char stellar_on_sapp_polling_entry(struct streaminfo *stream , void **pme , int thread_seq ,void *a_packet )
{
int ret = polling_on_sapp(g_stellar);
switch (ret)