Solaris 2.8/2.5.2 build issues

Jos Backus josb at cncdsl.com
Tue Jan 29 06:00:55 EST 2002


On Mon, Jan 28, 2002 at 09:54:35AM -0500, David Birnbaum wrote:
> gcc -I. -I. -g -O2 -DHAVE_CONFIG_H -Wall -W -I./popt -c main.c -o main.o
> main.c: In function `client_run':
> main.c:529: warning: `flist' might be used uninitialized in this function

Fixed by change the initialization to

    struct file_list *flist = NULL;

Btw, it just occurred to me that we have a couple of places where we assign 0
or NULL to file-scoped variables. Those assignments are unnecessary, as the C
standard guarantees that these variables will be set to 0.

Moreover, these assignments bloat the .data section unnecessarily instead of
living in the .bss section (variables in .bss will be set to 0 automatically,
those in .data will be set to their respective values contained in the .data
section).

> options.c:271: warning: missing initializer
> options.c:271: warning: (near initialization for
> `long_options[0].descrip')

All these can be fixed by properly padding the struct initializers with the
required values.

-- 
Jos Backus                 _/  _/_/_/        Santa Clara, CA
                          _/  _/   _/
                         _/  _/_/_/             
                    _/  _/  _/    _/
josb at cncdsl.com     _/_/   _/_/_/            use Std::Disclaimer;




More information about the rsync mailing list