extra compiler warnings

This commit is contained in:
Nedko Arnaudov 2012-12-02 21:39:51 +02:00
parent 73acf78b8d
commit abf820278b
7 changed files with 15 additions and 11 deletions

View File

@ -2,7 +2,7 @@
/* /*
* LADI Session Handler (ladish) * LADI Session Handler (ladish)
* *
* Copyright (C) 2009, 2010, 2011 Nedko Arnaudov <nedko@arnaudov.name> * Copyright (C) 2009,2010,2011,2012 Nedko Arnaudov <nedko@arnaudov.name>
* *
************************************************************************** **************************************************************************
* This file contains implementation of the "load studio" command * This file contains implementation of the "load studio" command
@ -50,7 +50,7 @@ static void callback_chrdata(void * data, const XML_Char * s, int len)
context_ptr->element[context_ptr->depth] == PARSE_CONTEXT_KEY || context_ptr->element[context_ptr->depth] == PARSE_CONTEXT_KEY ||
context_ptr->element[context_ptr->depth] == PARSE_CONTEXT_APPLICATION) context_ptr->element[context_ptr->depth] == PARSE_CONTEXT_APPLICATION)
{ {
if (context_ptr->data_used + len >= sizeof(context_ptr->data)) if ((size_t)(context_ptr->data_used + len) >= sizeof(context_ptr->data))
{ {
log_error("xml parse max char data length reached"); log_error("xml parse max char data length reached");
context_ptr->error = XML_TRUE; context_ptr->error = XML_TRUE;

View File

@ -444,7 +444,7 @@ loader_read_child_output(
*buffer_ptr_ptr = buffer_ptr + left; *buffer_ptr_ptr = buffer_ptr + left;
} }
} }
while (ret == max_read); /* if we have read everything as much as we can, then maybe there is more to read */ while ((size_t)ret == max_read); /* if we have read everything as much as we can, then maybe there is more to read */
} }
static void static void

View File

@ -97,7 +97,7 @@ loop:
ret = read(fd, read_ptr, max); ret = read(fd, read_ptr, max);
if (ret > 0) if (ret > 0)
{ {
ASSERT(ret <= max); ASSERT((size_t)ret <= max);
read_ptr += ret; read_ptr += ret;
used_size += ret; used_size += ret;
ASSERT(used_size <= buffer_size); ASSERT(used_size <= buffer_size);
@ -191,7 +191,7 @@ procfs_get_process_cmdline(
argc = 0; argc = 0;
temp_ptr = cmdline_ptr; temp_ptr = cmdline_ptr;
while (temp_ptr - cmdline_ptr < cmdline_size) while ((size_t)(temp_ptr - cmdline_ptr) < cmdline_size)
{ {
if (*temp_ptr == 0) if (*temp_ptr == 0)
{ {
@ -214,7 +214,7 @@ procfs_get_process_cmdline(
for (i = 0; i < argc; i++) for (i = 0; i < argc; i++)
{ {
ASSERT(temp_ptr - cmdline_ptr < cmdline_size); ASSERT((size_t)(temp_ptr - cmdline_ptr) < cmdline_size);
argv[i] = strdup(temp_ptr); argv[i] = strdup(temp_ptr);
if (argv[i] == NULL) if (argv[i] == NULL)

View File

@ -117,7 +117,7 @@ ladish_recent_store_load(
goto free; goto free;
} }
if (ret < (size_t)buffer_size) if ((size_t)ret < buffer_size)
{ {
/* this could be handled better but we dont care because it is expected for the file to be small enough */ /* this could be handled better but we dont care because it is expected for the file to be small enough */
log_error("read(%s) returned less bytes than requested", store_ptr->path); log_error("read(%s) returned less bytes than requested", store_ptr->path);

View File

@ -2,7 +2,7 @@
/* /*
* LADI Session Handler (ladish) * LADI Session Handler (ladish)
* *
* Copyright (C) 2010, 2011 Nedko Arnaudov <nedko@arnaudov.name> * Copyright (C) 2010,2011,2012 Nedko Arnaudov <nedko@arnaudov.name>
* *
************************************************************************** **************************************************************************
* This file contains the parts of room object implementation * This file contains the parts of room object implementation
@ -55,7 +55,7 @@ static void callback_chrdata(void * data, const XML_Char * s, int len)
context_ptr->element[context_ptr->depth] == PARSE_CONTEXT_DESCRIPTION || context_ptr->element[context_ptr->depth] == PARSE_CONTEXT_DESCRIPTION ||
context_ptr->element[context_ptr->depth] == PARSE_CONTEXT_NOTES) context_ptr->element[context_ptr->depth] == PARSE_CONTEXT_NOTES)
{ {
if (context_ptr->data_used + len >= sizeof(context_ptr->data)) if ((size_t)(context_ptr->data_used + len) >= sizeof(context_ptr->data))
{ {
log_error("xml parse max char data length reached"); log_error("xml parse max char data length reached");
context_ptr->error = XML_TRUE; context_ptr->error = XML_TRUE;

View File

@ -2,7 +2,7 @@
/* /*
* LADI Session Handler (ladish) * LADI Session Handler (ladish)
* *
* Copyright (C) 2010,2011 Nedko Arnaudov <nedko@arnaudov.name> * Copyright (C) 2010,2011,2012 Nedko Arnaudov <nedko@arnaudov.name>
* *
************************************************************************** **************************************************************************
* This file contains implementation of the settings dialog * This file contains implementation of the settings dialog
@ -31,7 +31,7 @@
void menu_request_settings(void) void menu_request_settings(void)
{ {
guint result; gint result;
GtkDialog * dialog; GtkDialog * dialog;
GtkToggleButton * autostart_studio_button; GtkToggleButton * autostart_studio_button;
GtkToggleButton * send_notifications_button; GtkToggleButton * send_notifications_button;

View File

@ -216,6 +216,10 @@ def configure(conf):
conf.env['BUILD_WERROR'] = not RELEASE conf.env['BUILD_WERROR'] = not RELEASE
add_cflag(conf, '-Wall') add_cflag(conf, '-Wall')
# lash_wrap code is generated by swig and causes warnings
if not conf.env['BUILD_PYLASH']:
add_cflag(conf, '-Wextra')
add_cflag(conf, '-Wno-unused-parameter')
if conf.env['BUILD_WERROR']: if conf.env['BUILD_WERROR']:
add_cflag(conf, '-Werror') add_cflag(conf, '-Werror')
# for pre gcc-4.4, enable optimizations so use of uninitialized variables gets detected # for pre gcc-4.4, enable optimizations so use of uninitialized variables gets detected