Bug 77979 - Bad source code
Summary: Bad source code
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: textutils
Version: 8.0
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-11-16 13:03 UTC by d.binderman
Modified: 2005-10-31 22:00 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-12-10 13:05:50 UTC
Embargoed:


Attachments (Terms of Use)

Description d.binderman 2002-11-16 13:03:37 UTC
Description of Problem:

Hello there,

I just tried to compile package textutils-2.0.21-5 from Redhat 8.0.

Here are some of the compiler messages.

human.c:158: warning: `power' might be used uninitialized in this function
cat.c:507: warning: `out_dev' might be used uninitialized in this function
cat.c:510: warning: `out_ino' might be used uninitialized in this function
od.c:1611: warning: `desired_width' might be used uninitialized in this function
od.c:1621: warning: `pseudo_start' might be used uninitialized in this function
paste.c:159: warning: `chr' might be used uninitialized in this function
pr.c:2433: warning: `chars' might be used uninitialized in this function
uniq.c:296: warning: `prevfield' might be used uninitialized in this function
uniq.c:297: warning: `prevlen' might be used uninitialized in this function

Here is a bunch of patches which fix the messages.

*** ./lib/human.c.old	2002-11-05 11:10:43.000000000 +0000
--- ./lib/human.c	2002-11-05 11:11:16.000000000 +0000
***************
*** 155,161 ****
    int base;
    int to_block_size;
    int tenths = 0;
!   int power;
    char *p;
  
    /* 0 means adjusted N == AMT.TENTHS;
--- 155,161 ----
    int base;
    int to_block_size;
    int tenths = 0;
!   int power = 0;
    char *p;
  
    /* 0 means adjusted N == AMT.TENTHS;
*** ./src/cat.c.old	2002-11-05 11:11:30.000000000 +0000
--- ./src/cat.c	2002-11-05 11:12:01.000000000 +0000
***************
*** 504,513 ****
    int argind;
  
    /* Device number of the output (file or whatever).  */
!   dev_t out_dev;
  
    /* I-node number of the output.  */
!   ino_t out_ino;
  
    /* Nonzero if the output file should not be the same as any input file. */
    int check_redirection = 1;
--- 504,513 ----
    int argind;
  
    /* Device number of the output (file or whatever).  */
!   dev_t out_dev = 0;
  
    /* I-node number of the output.  */
!   ino_t out_ino = 0;
  
    /* Nonzero if the output file should not be the same as any input file. */
    int check_redirection = 1;
*** ./src/od.c.old	2002-11-05 11:12:12.000000000 +0000
--- ./src/od.c	2002-11-05 11:12:52.000000000 +0000
***************
*** 1608,1614 ****
    int n_files;
    size_t i;
    int l_c_m;
!   size_t desired_width IF_LINT (= 0);
    int width_specified = 0;
    int n_failed_decodes = 0;
    int err;
--- 1608,1614 ----
    int n_files;
    size_t i;
    int l_c_m;
!   size_t desired_width = 0;
    int width_specified = 0;
    int n_failed_decodes = 0;
    int err;
***************
*** 1618,1624 ****
  
    /* The old-style `pseudo starting address' to be printed in parentheses
       after any true address.  */
!   uintmax_t pseudo_start IF_LINT (= 0);
  
    program_name = argv[0];
    setlocale (LC_ALL, "");
--- 1618,1624 ----
  
    /* The old-style `pseudo starting address' to be printed in parentheses
       after any true address.  */
!   uintmax_t pseudo_start = 0;
  
    program_name = argv[0];
    setlocale (LC_ALL, "");
*** ./src/paste.c.old	2002-11-05 11:13:08.000000000 +0000
--- ./src/paste.c	2002-11-05 11:13:27.000000000 +0000
***************
*** 156,162 ****
    /* Number of files for which space is allocated in `delbuf' and `fileptr'.
       Enlarged as necessary. */
    int file_list_size = 12;
!   int chr IF_LINT (= 0);	/* Input character. */
    int line_length;		/* Number of chars in line. */
    int somedone;			/* 0 if all files empty for this line. */
    /* If all files are just ready to be closed, or will be on this
--- 156,162 ----
    /* Number of files for which space is allocated in `delbuf' and `fileptr'.
       Enlarged as necessary. */
    int file_list_size = 12;
!   int chr = 0;			/* Input character. */
    int line_length;		/* Number of chars in line. */
    int somedone;			/* 0 if all files empty for this line. */
    /* If all files are just ready to be closed, or will be on this
*** ./src/pr.c.old	2002-11-05 11:13:39.000000000 +0000
--- ./src/pr.c	2002-11-05 11:13:54.000000000 +0000
***************
*** 2430,2436 ****
  read_line (COLUMN *p)
  {
    int c;
!   int chars IF_LINT (= 0);
    int last_input_position;
    int j, k;
    COLUMN *q;
--- 2430,2436 ----
  read_line (COLUMN *p)
  {
    int c;
!   int chars = 0;
    int last_input_position;
    int j, k;
    COLUMN *q;
*** ./src/uniq.c.old	2002-11-05 11:14:09.000000000 +0000
--- ./src/uniq.c	2002-11-05 11:14:25.000000000 +0000
***************
*** 293,300 ****
  
    if (mode == output_all && countmode == count_none)
      {
!       char *prevfield IF_LINT (= NULL);
!       size_t prevlen IF_LINT (= 0);
  
        while (!feof (istream))
  	{
--- 293,300 ----
  
    if (mode == output_all && countmode == count_none)
      {
!       char *prevfield = NULL;
!       size_t prevlen = 0;
  
        while (!feof (istream))
  	{


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


How Reproducible:


Steps to Reproduce:
1. 
2. 
3. 

Actual Results:


Expected Results:


Additional Information:


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