Bug 111278

Summary: 6 bad source codes
Product: [Fedora] Fedora Reporter: d.binderman
Component: tetexAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.0.2-10 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-12-03 17:57:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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: