Bug 78478 - bad source code
bad source code
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: which (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ngo Than
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-11-24 05:37 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: 2002-11-24 05:37:52 EST
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-24 05:37:45 EST
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-09 19:06:30 EST
it's fixed in which-2.14-3. thanks for your patch file

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