fixes for -Wmissing-declarations and -Wwrite-strings warnings

Francois Gouget fgouget at free.fr
Thu Jun 2 10:23:49 CDT 2005


On Thu, 2 Jun 2005, Pouech Eric DMI AEI CAEN wrote:

> returning a pointer to something on the stack is something I call an error
> (how do you ensure that the buffer will not get overwritten by another function call ?)

It's not returning a pointer to something on the stack. It is returning 
driversFound[0] which is a pointer to a string which may have been 
malloc()'ed (you stripped that part of the code).

>>> char *audioAutoDetect(void)
>>> {
>>> [snip]
>>> char *driversFound[10];
>>> [snip]

maybe driversFound[0]=malloc(something);

>>> return driversFound[0];
>>> [snip]
>>> }

-- 
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
         It really galls me that most of the computer power in the world
                           is wasted on screen savers.
                      Chris Caldwell from the GIMPS project
                        http://www.mersenne.org/prime.htm



More information about the wine-devel mailing list