[Genome] Compiler warnings about uninitialized variables on OS X Leopard

Hiram Clawson hiram at soe.ucsc.edu
Wed May 21 12:09:50 PDT 2008


Good Afternoon Pär:

Thanks for the notice on these warnings.  They have been
fixed in the source tree.

--Hiram

Pär Engström wrote:
> Hello,
> 
> I have encountered two problems compiling the kent source tree on Mac  
> OS X 10.5.2 (Leopard). Both of these problems can be fixed easily by a  
> couple of tiny changes to the source code. It would be great for us  
> Mac users if you could make these changes in the next release.
> 
> Both problems relate to compiler warnings about uninitialized  
> variables. One has been brought up earlier on the genome-mirror list:
> https://www.soe.ucsc.edu/pipermail/genome-mirror/2008-February/000733.html
> 
> The other is:
> 
> gcc -O  -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE - 
> DMACHTYPE_i386 -Wall -Werror -Wformat -Wimplicit -Wreturn-type - 
> Wuninitialized -I../inc -I../../inc -I../../../inc -I../../../../inc - 
> I../../../../../inc  -o pbCalPi.o -c pbCalPi.c
> cc1: warnings being treated as errors
> pbCalPi.c: In function ‘calPi’:
> pbCalPi.c:31: warning: ‘phMid’ may be used uninitialized in this  
> function
> make[3]: *** [pbCalPi.o] Error 1
> make[2]: *** [utils] Error 2
> make[1]: *** [utils] Error 2
> make: *** [utils] Error 2
> 
> After making the following changes to the source I can compile (run  
> "make libs" and "make utils") without problems:
> 
> In src/hg/lib/hgFind.c:
> 1202c1202
> < char *type;
> ---
>  > char *type = NULL;
> 
> In src/hg/protein/pbCalPi/pbCalPi.c
> 31c31
> < float charge, phMin, phMid, phMax;
> ---
>  > float charge, phMin, phMid = 0, phMax;
> 
> I checked out the source with cvs today and my gcc --version output is:
> i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465)
> Copyright (C) 2005 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There  
> is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR  
> PURPOSE.
> 
> Regards,
> 
> Pär
> 
> --
> Pär Engström
> Postdoctoral Fellow
> EMBL - European Bioinformatics Institute


More information about the Genome mailing list