Bug 78478

Summary: bad source code
Product: [Retired] Red Hat Linux Reporter: d.binderman
Component: whichAssignee: Than Ngo <than>
Status: CLOSED RAWHIDE QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-11-24 10:37:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description d.binderman 2002-11-24 10:37:45 UTC
Description of Problem:

Hello there,

I just tried to compile package which-2.14-1 from Redhat 8.0.

Here are some of the compiler messages.

tilde.c:185: warning: suggest parentheses around assignment used as truth value
which.c:554: warning: implicit declaration of function `isspace'
which.c:539: warning: `function_start_version_205b' might be used uninitialized
in this function

Here is a patch which fixes the message.

*** ./tilde/tilde.c.old	2002-11-06 11:58:05.000000000 +0000
--- ./tilde/tilde.c	2002-11-06 12:00:09.000000000 +0000
***************
*** 182,188 ****
    int result_size, result_index;
  
    result_index = result_size = 0;
!   if (result = strchr (string, '~'))
      result = xmalloc (result_size = (strlen (string) + 16));
    else
      result = xmalloc (result_size = (strlen (string) + 1));
--- 182,188 ----
    int result_size, result_index;
  
    result_index = result_size = 0;
!   if ((result = strchr (string, '~')) != 0)
      result = xmalloc (result_size = (strlen (string) + 16));
    else
      result = xmalloc (result_size = (strlen (string) + 1));
*** ./which.c.old	2002-11-06 12:00:28.000000000 +0000
--- ./which.c	2002-11-06 12:01:38.000000000 +0000
***************
*** 22,27 ****
--- 22,28 ----
  #include "getopt.h"
  #include "tilde/tilde.h"
  #include "bash.h"
+ #include <ctype.h>
  
  static const char *progname;
  
***************
*** 536,542 ****
      while (fgets(buf, sizeof(buf), stdin))
      {
        int looks_like_function_start = 0;
!       int function_start_version_205b;
        if (read_functions)
        {
  	// bash version 2.0.5a and older output a pattern for `str' like
--- 537,543 ----
      while (fgets(buf, sizeof(buf), stdin))
      {
        int looks_like_function_start = 0;
!       int function_start_version_205b = 0;
        if (read_functions)
        {
  	// bash version 2.0.5a and older output a pattern for `str' like
  


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


How Reproducible:


Steps to Reproduce:
1. 
2. 
3. 

Actual Results:


Expected Results:


Additional Information:

Comment 1 Ngo Than 2002-12-10 00:06:30 UTC
it's fixed in which-2.14-3. thanks for your patch file