server/fd.c: Prevent using uninitialized pointers
James McKenzie
jjmckenzie51 at earthlink.net
Sat Jul 4 14:03:15 CDT 2009
Henri Verbeet wrote:
> 2009/6/30 Daniel Santos <javatroubadour at yahoo.com>:
>
>> Some pointers are getting used prior to initialization. It would appear that the current compilers are initializing them to zero or we've been lucky.
>>
>>
> No, the C standard specifies that these are initialized to NULL, since
> they have static storage duration.
>
>
>
We are assuming that the c compilers are following the standard. I was
told a long time ago, 1994 to be exact, that if we want to insure that a
variable has a certain value to initialize it to that value. This
applies if we want a zero or a NULL.
[code]
int a = 0;
char b = NULL;
bool c = TRUE;
[/code]
Without this, we cannot assume anything.
James McKenzie
More information about the wine-devel
mailing list