Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 78478 - bad source code
Summary: bad source code
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: which
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ngo Than
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-11-24 10:37 UTC by d.binderman
Modified: 2007-04-18 16:48 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-11-24 10:37:52 UTC


Attachments (Terms of Use)

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


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