# Process with warn flags
SET(CMAKE_C_WARN_FLAGS "")
CHECK_C_COMPILER_FLAG(-Wall SUPPORT_WALL)
-CHECK_C_COMPILER_FLAG(-Wall SUPPORT_W)
+CHECK_C_COMPILER_FLAG(-W SUPPORT_W)
CHECK_C_COMPILER_FLAG(-Wpointer-arith SUPPORT_WPOINTER)
CHECK_C_COMPILER_FLAG(-Wno-unused-parameter SUPPORT_WPARAM)
CHECK_C_COMPILER_FLAG(-Wno-unused-function SUPPORT_WFUNCTION)
CHECK_C_COMPILER_FLAG(-Wunused-variable SUPPORT_WUNUSED_VAR)
CHECK_C_COMPILER_FLAG(-Wno-pointer-sign SUPPORT_WPOINTER_SIGN)
+CHECK_C_COMPILER_FLAG(-Wstrict-prototypes SUPPORT_WSTRICT_PROTOTYPES)
CHECK_C_COMPILER_FLAG(-pedantic SUPPORT_PEDANTIC_FLAG)
CHECK_C_COMPILER_FLAG("-std=c99" SUPPORT_STD_FLAG)
IF(SUPPORT_W)
IF(SUPPORT_WPOINTER_SIGN)
SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wno-pointer-sign")
ENDIF(SUPPORT_WPOINTER_SIGN)
+IF(SUPPORT_WSTRICT_PROTOTYPES)
+ SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wstrict-prototypes")
+ENDIF(SUPPORT_WSTRICT_PROTOTYPES)
IF(SUPPORT_PEDANTIC_FLAG)
SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -pedantic")
ENDIF(SUPPORT_PEDANTIC_FLAG)
# Optimization flags
IF(NOT CMAKE_C_OPT_FLAGS)
IF(ENABLE_OPTIMIZATION MATCHES "ON")
- SET(CMAKE_C_OPT_FLAGS "-O3")
+ SET(CMAKE_C_OPT_FLAGS "-O3 -fstrict-aliasing")
ELSE(ENABLE_OPTIMIZATION MATCHES "ON")
- SET(CMAKE_C_OPT_FLAGS "-O0")
+ SET(CMAKE_C_OPT_FLAGS "-O0 -fstrict-aliasing")
ENDIF(ENABLE_OPTIMIZATION MATCHES "ON")
ENDIF(NOT CMAKE_C_OPT_FLAGS)
typedef struct worker_s {
const gchar *name;
- gpointer (*worker_init_func)();
+ gpointer (*worker_init_func)(void);
void (*worker_start_func)(struct rspamd_worker *worker);
gboolean has_socket;
gboolean unique;
}
static gboolean
-maybe_init_static ()
+maybe_init_static (void)
{
if (!binlog_opened) {
binlog_opened = g_hash_table_new (g_direct_hash, g_direct_equal);
* Scan STDIN
*/
static void
-scan_rspamd_stdin ()
+scan_rspamd_stdin (void)
{
gchar *in_buf;
}
static void
-rspamd_do_stat ()
+rspamd_do_stat (void)
{
GError *err = NULL;
GString *res;
}
static void
-rspamd_do_uptime ()
+rspamd_do_uptime (void)
{
GError *err = NULL;
GString *res;
#define CONTROLLER_IO_TIMEOUT 120
/* Init functions */
-gpointer init_controller ();
+gpointer init_controller (void);
void start_controller (struct rspamd_worker *worker);
worker_t controller_worker = {
}
gpointer
-init_controller ()
+init_controller (void)
{
struct rspamd_controller_ctx *ctx;
GQuark type;
#define CURRENT_FUZZY_VERSION 1
/* Init functions */
-gpointer init_fuzzy ();
+gpointer init_fuzzy (void);
void start_fuzzy (struct rspamd_worker *worker);
worker_t fuzzy_worker = {
* Create new LRU cache
*/
struct rspamd_kv_expire*
-rspamd_lru_expire_new ()
+rspamd_lru_expire_new (void)
{
struct rspamd_kv_lru_expire *new;
/**
* LRU expire
*/
-struct rspamd_kv_expire* rspamd_lru_expire_new ();
+struct rspamd_kv_expire* rspamd_lru_expire_new (void);
/**
* Ordinary hash
} while (0)
/* Init functions */
-gpointer init_keystorage ();
+gpointer init_keystorage (void);
void start_keystorage (struct rspamd_worker *worker);
worker_t keystorage_worker = {
/* Prints info about incoming signals by parsing siginfo structures */
static void
-print_signals_info ()
+print_signals_info (void)
{
siginfo_t *inf;
/* By default allocate 8Kb chunks of memory */
#define FIXED_POOL_SIZE 8192
gsize
-memory_pool_get_size ()
+memory_pool_get_size (void)
{
#ifdef HAVE_GETPAGESIZE
return MAX (getpagesize (), FIXED_POOL_SIZE);
* Get optimal pool size based on page size for this system
* @return size of memory page in system
*/
-gsize memory_pool_get_size ();
+gsize memory_pool_get_size (void);
/**
* Set memory pool variable
static void *radix_alloc (radix_tree_t * tree);
radix_tree_t *
-radix_tree_create ()
+radix_tree_create (void)
{
radix_tree_t *tree;
/**
* Create new radix tree
*/
-radix_tree_t *radix_tree_create ();
+radix_tree_t *radix_tree_create (void);
/**
* Insert value to radix tree
static sig_atomic_t wanna_die = 0;
/* Init functions */
-gpointer init_smtp ();
+gpointer init_smtp (void);
void start_smtp (struct rspamd_worker *worker);
worker_t smtp_worker = {
static sig_atomic_t wanna_die = 0;
/* Init functions */
-gpointer init_smtp_proxy ();
+gpointer init_smtp_proxy (void);
void start_smtp_proxy (struct rspamd_worker *worker);
worker_t smtp_proxy_worker = {
* @return mutex or NULL
*/
inline rspamd_mutex_t*
-rspamd_mutex_new ()
+rspamd_mutex_new (void)
{
rspamd_mutex_t *new;
* @return
*/
rspamd_rwlock_t*
-rspamd_rwlock_new ()
+rspamd_rwlock_new (void)
{
rspamd_rwlock_t *new;
* Create new mutex
* @return mutex or NULL
*/
-rspamd_mutex_t* rspamd_mutex_new ();
+rspamd_mutex_t* rspamd_mutex_new (void);
/**
* Lock mutex
* Create new rwloc
* @return
*/
-rspamd_rwlock_t* rspamd_rwlock_new ();
+rspamd_rwlock_t* rspamd_rwlock_new (void);
/**
* Lock rwlock for writing