Bug 110900 - bad source code
Summary: bad source code
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: nss_db
Version: 1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-11-25 12:32 UTC by d.binderman
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-04-21 16:50:53 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description d.binderman 2003-11-25 12:32:42 UTC
Description of problem:

I just tried to compile package nss_db-2_2-22 with  compiler
flag -Wall.

The compiler said

../db_load/db_load.c:810: warning: operation on `instr' may be 
undefined

The source code is

                        c = digitize(dbenv, *instr, &e1) << 4 |
                            digitize(dbenv, *++instr, &e2);

Much better code is

                        c = digitize(dbenv, instr[ 0], &e1) << 4 |
                            digitize(dbenv, instr[ 1], &e2);
                        ++instr;


Version-Release number of selected component (if applicable):
nss_db-2_2-22 

How reproducible:


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


Expected results:


Additional info:

Comment 1 David Binderman 2004-11-24 10:17:52 UTC
This code is still broken in Fedoara Core 3, nearly a 
year later.

Comment 2 John Thacker 2006-04-21 16:50:53 UTC
This is only a warning, not an error.  The code works as expected.  There's no
reason to patch upstream code just to fix a warning.


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