Bug 75785 - Bad source code
Bad source code
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: krb5 (Show other bugs)
7.2
All Linux
medium Severity high
: ---
: ---
Assigned To: Nalin Dahyabhai
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-10-12 07:44 EDT by d.binderman
Modified: 2007-04-18 12:47 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-04-22 01:03:00 EDT
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-10-12 07:44:45 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.6 [en-gb]C-CCK-MCD NetscapeOnline.co.uk  (Win98; I)

Description of problem:

// not known. Send to Redhat instead.

I just tried to compile package krb5-1.2.2-13, from the new Redhat
7.2 for Alpha, with the new gcc 3.2 compiler.

It said 

1.

client.c:220: warning: too few arguments for format
client.c:326: warning: too few arguments for format

There are more % specifiers than parameters. If executed, this
code will print rubbish.

2.

./ftpcmd.y:1281: warning: operation on `state' may be undefined

The source code is

	state = state == OSTR ? STR2 : ++state;

In C, it is dangerous to increment the same variable as well as read
& write to it in the same statement, because the reads & writes will
get interleaved.

The following is better source code

	if (state == OSTR)
	{
		state = STR2;
	}
	else
	{
		++state;
	}

3.

../hash/hash_page.c:1076: warning: `freep' might be used uninitialized in this function
../btree/bt_delete.c:153: warning: `index' might be used uninitialized in this function
../btree/bt_put.c:75: warning: `e' might be used uninitialized in this function
../btree/bt_search.c:160: warning: `index' might be used uninitialized in this function
../btree/bt_search.c:240: warning: `index' might be used uninitialized in this function
../btree/bt_seq.c:247: warning: `index' might be used uninitialized in this function
../btree/bt_split.c:90: warning: `bi' might be used uninitialized in this function
../btree/bt_split.c:91: warning: `bl' might be used uninitialized in this function
../btree/bt_split.c:97: warning: `nksize' might be used uninitialized in this function
../btree/bt_split.c:624: warning: `src' might be used uninitialized in this function
../recno/rec_open.c:68: warning: `rfd' might be used uninitialized in this function
kta_ops.c:199: warning: `kerror' might be used uninitialized in this function
kta_ops.c:219: warning: `kerror' might be used uninitialized in this function
kta_ops.c:199: warning: `kerror' might be used uninitialized in this function
kta_ops.c:219: warning: `kerror' might be used uninitialized in this function
pcbc_encrypt.c:47: warning: `plainl' might be used uninitialized in this function
pcbc_encrypt.c:48: warning: `plainr' might be used uninitialized in this function
pcbc_encrypt.c:47: warning: `plainl' might be used uninitialized in this function
pcbc_encrypt.c:48: warning: `plainr' might be used uninitialized in this function
pmap_prot2.c:96: warning: `next' might be used uninitialized in this function
pmap_prot2.c:96: warning: `next' might be used uninitialized in this function
cmds.c:204: warning: `c' might be used uninitialized in this function
domacro.c:51: warning: `j' might be used uninitialized in this function
telnet.c:1730: warning: `sbp' might be used uninitialized in this function

I count 24 cases where the compiler suspects there may be a problem.


Version-Release number of selected component (ifapplicable):


How reproducible:
Always

Steps to Reproduce:
1. compile with new gcc compiler
2.
3.
	

Additional info:
Comment 1 John Thacker 2006-04-22 01:03:00 EDT
Not going to patch upstream code to quiet a compiler warning rather 
than fix a bug or error.

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