Bug 78706 - bad source code
bad source code
Status: CLOSED NEXTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: libtiff (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Matthias Clasen
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-11-27 18:27 EST by d.binderman
Modified: 2007-04-18 12:48 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-05-19 16:22:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description d.binderman 2002-11-27 18:27:38 EST
Description of Problem:

Hello there,

I just tried to compile package libtiff-3.5.7-7 from Redhat 8.0.

Here are some of the compiler messages.

../tools/fax2tiff.c:77: warning: `whandler' might be used uninitialized in this
function
../tools/ppm2tiff.c:61: warning: `photometric' might be used uninitialized in this function
../tools/ppm2tiff.c:67: warning: `spp' might be used uninitialized in this function
../tools/tiff2ps.c:948: warning: `breaklen' might be used uninitialized in this
function
../tools/tiffmedian.c:406: warning: `first' might be used uninitialized in this
function
../tools/tiffmedian.c:406: warning: `last' might be used uninitialized in this function
../tools/tiffset.c:89: warning: too few arguments for format
../tools/tiffset.c:115: warning: too few arguments for format

Here is a patch which fixes the messages.

*** ./tools/fax2tiff.c.old	2002-11-13 10:33:06.000000000 +0000
--- ./tools/fax2tiff.c	2002-11-13 10:33:19.000000000 +0000
***************
*** 74,80 ****
  {
  	FILE *in;
  	TIFF *out = NULL;
! 	TIFFErrorHandler whandler;
  	int compression = COMPRESSION_CCITTFAX3;
  	int fillorder = FILLORDER_LSB2MSB;
  	uint32 group3options = GROUP3OPT_FILLBITS|GROUP3OPT_2DENCODING;
--- 74,80 ----
  {
  	FILE *in;
  	TIFF *out = NULL;
! 	TIFFErrorHandler whandler = 0;
  	int compression = COMPRESSION_CCITTFAX3;
  	int fillorder = FILLORDER_LSB2MSB;
  	uint32 group3options = GROUP3OPT_FILLBITS|GROUP3OPT_2DENCODING;
*** ./tools/ppm2tiff.c.old	2002-11-13 10:33:38.000000000 +0000
--- ./tools/ppm2tiff.c	2002-11-13 10:34:02.000000000 +0000
***************
*** 58,70 ****
  int
  main(int argc, char* argv[])
  {
! 	uint16 photometric;
  	uint32 rowsperstrip = (uint32) -1;
  	double resolution = -1;
  	unsigned char *buf = NULL;
  	uint32 row;
  	tsize_t linebytes;
! 	uint16 spp;
  	TIFF *out;
  	FILE *in;
  	uint32 w, h;
--- 58,70 ----
  int
  main(int argc, char* argv[])
  {
! 	uint16 photometric = 0;
  	uint32 rowsperstrip = (uint32) -1;
  	double resolution = -1;
  	unsigned char *buf = NULL;
  	uint32 row;
  	tsize_t linebytes;
! 	uint16 spp = 0;
  	TIFF *out;
  	FILE *in;
  	uint32 w, h;
*** ./tools/tiff2ps.c.old	2002-11-13 10:34:23.000000000 +0000
--- ./tools/tiff2ps.c	2002-11-13 10:34:40.000000000 +0000
***************
*** 945,951 ****
  PS_Lvl2page(FILE* fd, TIFF* tif, uint32 w, uint32 h)
  {
  	uint16 fillorder;
! 	int use_rawdata, tiled_image, breaklen;
  	uint32 chunk_no, num_chunks, *bc;
  	unsigned char *buf_data, *cp;
  	tsize_t chunk_size, byte_count;
--- 945,951 ----
  PS_Lvl2page(FILE* fd, TIFF* tif, uint32 w, uint32 h)
  {
  	uint16 fillorder;
! 	int use_rawdata, tiled_image, breaklen = 0;
  	uint32 chunk_no, num_chunks, *bc;
  	unsigned char *buf_data, *cp;
  	tsize_t chunk_size, byte_count;
*** ./tools/tiffmedian.c.old	2002-11-13 10:35:02.000000000 +0000
--- ./tools/tiffmedian.c	2002-11-13 10:35:21.000000000 +0000
***************
*** 403,409 ****
  splitbox(Colorbox* ptr)
 {
  	int		hist2[B_LEN];
! 	int		first, last;
  	register Colorbox	*new;
  	register int	*iptr, *histp;
  	register int	i, j;
--- 403,409 ----
  splitbox(Colorbox* ptr)
  {
  	int		hist2[B_LEN];
! 	int		first = 0, last = 0;
  	register Colorbox	*new;
  	register int	*iptr, *histp;
  	register int	i, j;
*** ./tools/tiffset.c.old	2002-11-13 10:35:37.000000000 +0000
--- ./tools/tiffset.c	2002-11-13 10:37:41.000000000 +0000
***************
*** 86,92 ****
  
              if( id < 1 )
              {
!                 fprintf( stderr, "Field name %s not recognised.\n" );
                  exit( -3 );
              }
  
--- 86,93 ----
  
              if( id < 1 )
              {
!                 fprintf( stderr, "Field name %s not recognised.\n",
! 				argv[arg_index+1] );
                  exit( -3 );
              }
  
***************
*** 112,118 ****
  
              if( id < 1 )
              {
!                 fprintf( stderr, "Field name %s not recognised.\n" );
                  exit( -3 );
              }
  
--- 113,120 ----
  
              if( id < 1 )
              {
!                 fprintf( stderr, "Field name %s not recognised.\n",
! 				argv[arg_index+1] );
                  exit( -3 );
              }
  


Version-Release number of selected component (if applicable):


How Reproducible:


Steps to Reproduce:
1. 
2. 
3. 

Actual Results:


Expected Results:


Additional Information:
Comment 1 Matthias Clasen 2004-05-19 15:52:39 EDT
These are all harmless and caused by insufficient understanding of the
program flow on the part of the compiler. 
Comment 2 d.binderman 2004-05-19 16:00:46 EDT
Including the last two ?
Comment 3 Matthias Clasen 2004-05-19 16:22:27 EDT
The last two are fixed upstream in 3.6.1, which I'm currently packaging

Note You need to log in before you can comment on or make changes to this bug.