I believe the following patch of programs/winecfg/libraries.c
revision 1.3 date: 2004/09/28 03:55:16; author: julliard; state: Exp; lines: +288 -501 Mike Hearn mike@navi.cx - rewrite the transaction system to be based on a settings overlay, to have a nicer API, and to actually work (always a bonus) - change the libraries page to be based on a listbox rather than a treeview, clean up and shrink the code - add accelerator keys to the libraries page, focus management - make the window title reflect what the user is currently editing - remove bogus root warning - remove some unused control IDs in resource.h - start converting the x11drv dialog to kernel_style from javaStyle - bugfixing
introduced the following warnings
libraries.c:261: warning: `mode' might be used uninitialized in this function libraries.c:264: warning: `str' might be used uninitialized in this function
(which are the only ones of this kind for a full Wine build).
Gerald
Le sam 16/10/2004 à 09:11, Gerald Pfeifer a écrit : [snip]
libraries.c:261: warning: `mode' might be used uninitialized in this function libraries.c:264: warning: `str' might be used uninitialized in this function
(which are the only ones of this kind for a full Wine build).
Depends on which gcc version you use, because here (3.2) I don't have them.
The mode warning is somewhat safe (there's an assert if it's not set).
The str warning is in the same boat (there's also an assert if it's not set).
It could be argued that it'd be good practice to initialize them regardless.
Vincent
On Sat, Oct 16, 2004 at 12:31:49PM -0400, Vincent Béron wrote:
Le sam 16/10/2004 à 09:11, Gerald Pfeifer a écrit : [snip]
libraries.c:261: warning: `mode' might be used uninitialized in this function libraries.c:264: warning: `str' might be used uninitialized in this function
(which are the only ones of this kind for a full Wine build).
Depends on which gcc version you use, because here (3.2) I don't have them.
The mode warning is somewhat safe (there's an assert if it's not set).
The str warning is in the same boat (there's also an assert if it's not set).
It could be argued that it'd be good practice to initialize them regardless.
There is an assert() blocking the default switch() case. However, the assert goes away completely with -DNDEBUG, so following patch should be applied.
Ciao, Marcus
Changelog: return out of the default case, assert() is removed with -DNDEBUG.
Index: programs/winecfg/libraries.c =================================================================== RCS file: /home/wine/wine/programs/winecfg/libraries.c,v retrieving revision 1.3 diff -u -r1.3 libraries.c --- programs/winecfg/libraries.c 28 Sep 2004 03:55:16 -0000 1.3 +++ programs/winecfg/libraries.c 16 Oct 2004 20:36:45 -0000 @@ -274,6 +274,7 @@ CONVERT( DISABLE );
default: assert( FALSE ); /* should not be reached */ + return; }
#undef CONVERT @@ -291,6 +292,7 @@ case NATIVE_BUILTIN: str = "native, builtin"; break; case DISABLE: str = ""; break; default: assert( FALSE ); /* unreachable */ + return; } WINE_TRACE("Setting %s to %s\n", dll->name, str);