Bug 111278 - 6 bad source codes
Summary: 6 bad source codes
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: tetex
Version: 1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-12-01 18:24 UTC by d.binderman
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version: 2.0.2-10
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-12-03 17:57:48 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description d.binderman 2003-12-01 18:24:59 UTC
Description of problem:
I just tried to compile package tetex-2.0.2-8 from Fedora.

The compiler said

1.

mapfile.c:164: warning: operation on `str' may be undefined

The source code is

        hash_code_upper ^= (*str << 8) + *++str;

This code is undefined. Better code is

        hash_code_upper ^= (str[ 0] << 8) + str[ 1];
		++str;

2.

mapfile.c:168: warning: operation on `str' may be undefined

Same problem again.

3.

emspecial.c:1052: warning: operation on `s' may be undefined

The source code is

                    *s++ = (*s & 0xf0) | (ch & 0x0f);
Better code is
                    *s = (*s & 0xf0) | (ch & 0x0f);
					++s;

4.

token.c:111: warning: operation on `exponent' may be undefined

The source code is

    exponent = -(++exponent >> 1); /* portable C for -(exponent/2) */

It is not wise to increment a variable and assign to it in the
same statement. The comment is particularly wrong.

5.

pdftex1.c(4333): remark #592: variable "notprintedplusyet" is used
before its value is set

Missing initialisation of local variable notprintedplusyet.

6.

pdfetex1.c(7150): remark #592: variable "notprintedplusyet" is used
before its value is set

Same problem as above.



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

How reproducible:


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


Expected results:


Additional info:


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