From: Paul Eggert Date: Sat, 16 Apr 2011 23:11:35 +0000 (-0700) Subject: Static checks with GCC 4.6.0 and non-default toolkits. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~268 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fd35b6f96777be3305879a9ca60ab5befb254042;p=emacs.git Static checks with GCC 4.6.0 and non-default toolkits. --- fd35b6f96777be3305879a9ca60ab5befb254042 diff --cc lib-src/ChangeLog index e3d7edf94bd,456e286503b..c45da107a8c --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@@ -1,3 -1,16 +1,18 @@@ + 2011-04-16 Paul Eggert + ++ Static checks with GCC 4.6.0 and non-default toolkits. ++ + * movemail.c (mail_spool_name): Protoize. + (main): Remove unused var. Mark var as initialized. + Move locals to avoid shadowing, and use time_t for times. + + * fakemail.c (xmalloc, xreallc): Use standard C prototypes + with void *. This avoids warnings about pointer casts. + + * emacsclient.c (main): Don't use uninitialized var. + (IS_ANY_SEP): Remove; unused. + (get_current_dir_name): Add an extern decl. + 2011-04-06 Paul Eggert Fix more problems found by GCC 4.6.0's static checks. diff --cc lwlib/ChangeLog index 64ae2fe085d,91f79536a42..e98526f2546 --- a/lwlib/ChangeLog +++ b/lwlib/ChangeLog @@@ -1,3 -1,17 +1,19 @@@ + 2011-04-16 Paul Eggert + ++ Static checks with GCC 4.6.0 and non-default toolkits. ++ + * lwlib-Xm.c (make_dialog): Rename local to avoid shadowing. + (make_menu_in_widget): Add cast to avoid warning. + * lwlib-utils.c (XtCompositeChildren): Likewise. + + * lwlib.c (EXPLAIN, destroy_one_instance): Avoid "else;". + (first_child) [USE_MOTIF]: Protoize. + + * lwlib-utils.h, lwlib-utils.c (XtSafelyDestroyWidget): Remove; unused. + + * xlwmenu.c (XlwMenuSetValues): Rename/ move locals to avoid shadowing. + (MINL): Define only if not emacs. + 2011-03-07 Chong Yidong * Version 23.3 released. diff --cc oldXMenu/ChangeLog index f0e650ab4b3,9dd6cc954d5..b40b5ca7084 --- a/oldXMenu/ChangeLog +++ b/oldXMenu/ChangeLog @@@ -1,3 -1,41 +1,43 @@@ + 2011-04-16 Paul Eggert + ++ Static checks with GCC 4.6.0 and non-default toolkits. ++ + Modernize to C89, for better static checking. + * Activate.c (XMenuActivate): Callback's first arg is readonly. + * AddPane.c (XMenuAddPane): Label is readonly. Rename local + to avoid shadowing. + * AddSel.c (XMenuAddSelection): Help arg is readonly. Rename local. + * Create.c (atoi, atof): Remove decls; include . + (MAX_INACT_PNUM, TILE_BUF_SIZE): Remove; unused. + (x_get_resource_string): Args are readonly. + (XAllocDisplayColor): colorName is readonly. + (XMenuCreate): def_env is readonly. Remove unused locals. Avoid + "else;". + * Destroy.c (XMenuDestroy): Return void. + * Error.c (XMenuError): Remove const pointer. + * EvHand.c (XMenuEventHandler): Return void. + * FindPane.c, FindSel.c: Include . + * InsPane.c (XMenuInsertPane): Rename local to avoid shadowing. + * InsSel.c (XMenuInsertSelection): Likewise. + * Internal.c (toggle_color, BUFFER_SIZE): Remove; unused. + (_XMErrorList): Now const. + (_XMWinQueInit, _XMRecomputeGlobals, _XMTransToOrigin, _XMRefreshPane): + (_XMRefreshSelection): Return void. + (_XMWinQueFlush, _XMRefreshSelection): Rename locals to avoid + shadowing. + (_XMWinQueFlush): Use stack, not heap. Don't use uninitialized var. + * SetAEQ.c (XMenuSetAEQ): Now returns void. + * SetFrz.c (XMenuSetFreeze): Likewise. + * X10.h (XAssoc): Use void * for generic pointer. + * XDelAssoc.c: Include XMenuInt.h rather than duplicating part of it. + * XDestAssoc.c, XMakeAssoc.c: Likewise. + * XDestAssoc.c (XDestroyAssocTable): Return void. + * XMakeAssoc.c (XMakeAssoc): Use void * for generic pointer. + * XMenu.h, XMenuInt.h: Adjust to signature changes. Use const + for pointers to readonly storage. + * insque.c: Include XMenuInt.h, to check our own signature. + (emacs_insque, emacs_remque): Use void * for generic pointers. + 2011-03-07 Chong Yidong * Version 23.3 released. diff --cc src/ChangeLog index d9f764cde85,ded7da730fe..908f885cafd --- a/src/ChangeLog +++ b/src/ChangeLog @@@ -1,3 -1,105 +1,107 @@@ + 2011-04-16 Paul Eggert + ++ Static checks with GCC 4.6.0 and non-default toolkits. ++ + * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl. + + * process.c (keyboard_bit_set): Define only if SIGIO. + (send_process_trap): Mark it with NO_RETURN if it doesn't return. + (send_process): Repair possible setjmp clobbering. + + * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'. + + * eval.c: Include , for vsnprintf on non-GNU/Linux hosts. + + * data.c (arith_error): Mark with NO_RETURN if it doesn't return. + + * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED): + Define only if needed. + + * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier + by pacifying GCC about it. Maybe it's time to retire it? + * xfaces.c (USG, __TIMEVAL__): Likewise. + + * dispextern.h (struct redisplay_interface): Rename param + to avoid shadowing. + * termhooks.h (struct terminal): Likewise. + * xterm.c (xembed_send_message): Likewise. + + * insdel.c (make_gap_smaller): Define only if + USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC. + + * keyboard.c (read_char): Make a var volatile so longjmp won't clobber + it. + + * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used, + so that we aren't warned about unused symbols. + + * xfns.c (Fx_file_dialog): Rename local to avoid shadowing. + + * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512). + + * xfns.c (x_real_positions): Mark locals as initialized. + + * xmenu.c (xmenu_show): Don't use uninitialized vars. + + * xterm.c: Fix problems found by static analysis with other toolkits. + (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT. + (x_dispatch_event): Declare static if USE_GTK, and + define if USE_GTK || USE_X_TOOLKIT. + (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK. + * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT. + * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only if + defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK. + + * xmenu.c (menu_help_callback): Pointer type fixes. + Use const pointers when pointing at readonly data. Avoid pointer + signedness clashes. + (FALSE): Remove unused macro. + (update_frame_menubar): Remove unused decl. + + * xfns.c (Fx_hide_tip): Move locals to avoid shadowing. + + * menu.c (push_submenu_start, push_submenu_end): Do not define unless + USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI. + (single_menu_item): Rename local to avoid shadowing. + + * keyboard.c (make_lispy_event): Remove unused local var. + + * frame.c, frame.h (x_get_resource_string): Bring this back, but + only if HAVE_X_WINDOWS && !USE_X_TOOLKIT. + + * bitmaps: Change bitmaps from unsigned char back to the X11 + compatible char. Avoid the old compiler warnings about + out-of-range initializers by using, for example, '\xab' rather + than 0xab. + + * xgselect.c (xgselect_initialize): Check vs interface + even if ! (defined (USE_GTK) || defined (HAVE_GCONF)). + + * xmenu.c (xmenu_show): Rename parm to avoid shadowing. + + * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers + to read-only memory. + + * fns.c (vector): Remove; this old hack is no longer needed. + + * xsmfns.c (create_client_leader_window): Rename shadowing arg. + Remove unused var. + (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define. + + * xrdb.c (x_load_resources): Omit unused local. + + * xfns.c (free_frame_menubar, atof): Remove duplicate decls. + (x_window): Rename locals to avoid shadowing. + (USG): Use the kludged USG macro, to pacify gcc. + + * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused. + (x_term_init): Remove local to avoid shadowing. + + * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl. + + * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if + USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then. + 2011-04-16 Eli Zaretskii * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.