Bug 80641

Summary: bad source code
Product: [Retired] Red Hat Linux Reporter: d.binderman
Component: CannaAssignee: Akira TAGOH <tagoh>
Status: CLOSED DUPLICATE QA Contact: Bill Huang <bhuang>
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: 2006-02-21 18:50:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description d.binderman 2002-12-29 09:23:58 UTC
Description of problem:

Hello there,

I have just tried to compile package Canna-3.5b2-70.

I got the following two messages from the compiler.

cc: Warning: cshost.c, line 197: Non-void function "WriteToServer" does not contain a return statement. (missingreturn)
int
^

cc: Error: kctrl.c, line 2181: In this statement, a common type could not be determined for the 2nd and 3rd operands ("strdup(...)" and "(char ...)0") of 
a conditional operator. (badcondit)
    uname = arg->uname ? strdup(arg->uname) : (char *)0;
------------^


Here is a suggested patch for a minor tidy up

./Canna35b2/cmd/cshost/cshost.c.old ./Canna35b2/cmd/cshost/cshost.c
*** ./Canna35b2/cmd/cshost/cshost.c.old	Sat Nov 30 14:05:17 2002
--- ./Canna35b2/cmd/cshost/cshost.c	Sat Nov 30 14:20:59 2002
***************
*** 72,77 ****
--- 72,79 ----
  
  extern int errno;
  
+ static void WriteToServer( char * Buffer, int size );
+ 
  main(argc, argv)
  int argc ;
  char **argv ;
***************
*** 194,203 ****
      }
      RkwFinalize();						/* S000 */
  }
! int
! WriteToServer( Buffer, size )
! char *Buffer ;
! int size ;
  {
      register int todo;
      register int write_stat;
--- 196,204 ----
      }
      RkwFinalize();						/* S000 */
  }
! 
! static void
! WriteToServer( char * Buffer, int size )
  {
      register int todo;
      register int write_stat;
./Canna35b2/lib/canna/kctrl.c.old ./Canna35b2/lib/canna/kctrl.c
*** ./Canna35b2/lib/canna/kctrl.c.old	Sat Nov 30 14:09:18 2002
--- ./Canna35b2/lib/canna/kctrl.c	Sat Nov 30 14:09:29 2002
***************
*** 27,32 ****
--- 27,33 ----
  #include "canna.h"
  
  #include <errno.h>
+ #include <string.h>
  #include <sys/types.h>
  #include <canna/mfdef.h>
  


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


How reproducible:


Steps to Reproduce:
1.
2.
3.
    
Actual results:


Expected results:


Additional info:

Comment 1 d.binderman 2002-12-29 09:24:00 UTC
Description of problem:

Hello there,

I have just tried to compile package Canna-3.5b2-70.

I got the following two messages from the compiler.

cc: Warning: cshost.c, line 197: Non-void function "WriteToServer" does not contain a return statement. (missingreturn)
int
^

cc: Error: kctrl.c, line 2181: In this statement, a common type could not be determined for the 2nd and 3rd operands ("strdup(...)" and "(char ...)0") of 
a conditional operator. (badcondit)
    uname = arg->uname ? strdup(arg->uname) : (char *)0;
------------^


Here is a suggested patch for a minor tidy up

./Canna35b2/cmd/cshost/cshost.c.old ./Canna35b2/cmd/cshost/cshost.c
*** ./Canna35b2/cmd/cshost/cshost.c.old	Sat Nov 30 14:05:17 2002
--- ./Canna35b2/cmd/cshost/cshost.c	Sat Nov 30 14:20:59 2002
***************
*** 72,77 ****
--- 72,79 ----
  
  extern int errno;
  
+ static void WriteToServer( char * Buffer, int size );
+ 
  main(argc, argv)
  int argc ;
  char **argv ;
***************
*** 194,203 ****
      }
      RkwFinalize();						/* S000 */
  }
! int
! WriteToServer( Buffer, size )
! char *Buffer ;
! int size ;
  {
      register int todo;
      register int write_stat;
--- 196,204 ----
      }
      RkwFinalize();						/* S000 */
  }
! 
! static void
! WriteToServer( char * Buffer, int size )
  {
      register int todo;
      register int write_stat;
./Canna35b2/lib/canna/kctrl.c.old ./Canna35b2/lib/canna/kctrl.c
*** ./Canna35b2/lib/canna/kctrl.c.old	Sat Nov 30 14:09:18 2002
--- ./Canna35b2/lib/canna/kctrl.c	Sat Nov 30 14:09:29 2002
***************
*** 27,32 ****
--- 27,33 ----
  #include "canna.h"
  
  #include <errno.h>
+ #include <string.h>
  #include <sys/types.h>
  #include <canna/mfdef.h>
  


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


How reproducible:


Steps to Reproduce:
1.
2.
3.
    
Actual results:


Expected results:


Additional info:

Comment 2 Akira TAGOH 2003-04-21 10:06:16 UTC

*** This bug has been marked as a duplicate of 80639 ***

Comment 3 Red Hat Bugzilla 2006-02-21 18:50:45 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.