diff --git a/m4.include/mc-cflags.m4 b/m4.include/mc-cflags.m4 index 8f143118c..76540a5ec 100644 --- a/m4.include/mc-cflags.m4 +++ b/m4.include/mc-cflags.m4 @@ -71,6 +71,7 @@ dnl Sorted -W options: MC_CHECK_ONE_CFLAG([-Wno-long-long]) MC_CHECK_ONE_CFLAG([-Wno-unreachable-code]) MC_CHECK_ONE_CFLAG([-Wparentheses]) + MC_CHECK_ONE_CFLAG([-Wpointer-arith]) MC_CHECK_ONE_CFLAG([-Wpointer-sign]) MC_CHECK_ONE_CFLAG([-Wredundant-decls]) MC_CHECK_ONE_CFLAG([-Wreturn-type]) diff --git a/src/filemanager/panel.c b/src/filemanager/panel.c index 28974b973..9350d94d0 100644 --- a/src/filemanager/panel.c +++ b/src/filemanager/panel.c @@ -1544,7 +1544,7 @@ panel_get_title_without_hotkey (const char *title) hkey = strchr (translated_title, '&'); if (hkey != NULL && hkey[1] != '\0') - memmove ((void *) hkey, (void *) hkey + 1, strlen (hkey)); + memmove (hkey, hkey + 1, strlen (hkey)); } return translated_title; diff --git a/src/vfs/sftpfs/config_parser.c b/src/vfs/sftpfs/config_parser.c index cd954e12c..5582b832e 100644 --- a/src/vfs/sftpfs/config_parser.c +++ b/src/vfs/sftpfs/config_parser.c @@ -131,8 +131,9 @@ sftpfs_correct_file_name (const char *filename) /* --------------------------------------------------------------------------------------------- */ +/* FIXME: is pointer arith correct here? */ #define POINTER_TO_STRUCTURE_MEMBER(type) \ - ((type) ((void *) config_entity + (off_t) config_variables[i].offset)) + ((type) (config_entity + (off_t) config_variables[i].offset)) /** * Parse string and filling one config entity by parsed data. diff --git a/src/viewer/growbuf.c b/src/viewer/growbuf.c index 1b078b80b..64d2bb2bc 100644 --- a/src/viewer/growbuf.c +++ b/src/viewer/growbuf.c @@ -155,8 +155,8 @@ mcview_growbuf_read_until (mcview_t * view, off_t ofs) g_ptr_array_add (view->growbuf_blockptr, newblock); view->growbuf_lastindex = 0; } - p = g_ptr_array_index (view->growbuf_blockptr, - view->growbuf_blockptr->len - 1) + view->growbuf_lastindex; + + p = (byte *) g_ptr_array_index (view->growbuf_blockptr, view->growbuf_blockptr->len - 1) + view->growbuf_lastindex; bytesfree = VIEW_PAGE_SIZE - view->growbuf_lastindex; @@ -293,10 +293,10 @@ mcview_get_ptr_growing_buffer (mcview_t * view, off_t byte_index) if (view->growbuf_blockptr->len == 0) return NULL; if (pageno < (off_t) view->growbuf_blockptr->len - 1) - return (char *) (g_ptr_array_index (view->growbuf_blockptr, pageno) + pageindex); + return ((char *) g_ptr_array_index (view->growbuf_blockptr, pageno) + pageindex); if (pageno == (off_t) view->growbuf_blockptr->len - 1 && pageindex < (off_t) view->growbuf_lastindex) - return (char *) (g_ptr_array_index (view->growbuf_blockptr, pageno) + pageindex); + return ((char *) g_ptr_array_index (view->growbuf_blockptr, pageno) + pageindex); return NULL; }