Bug 111278 - 6 bad source codes
6 bad source codes
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: tetex (Show other bugs)
1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-12-01 13:24 EST by d.binderman
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version: 2.0.2-10
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-12-03 12:57:48 EST
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 2003-12-01 13:24:59 EST
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.