Bug 75785 - Bad source code
Summary: Bad source code
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: krb5
Version: 7.2
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-10-12 11:44 UTC by d.binderman
Modified: 2007-04-18 16:47 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-04-22 05:03:00 UTC
Embargoed:


Attachments (Terms of Use)

Description d.binderman 2002-10-12 11:44:45 UTC
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 05:03:00 UTC
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.