Bug 101032 - bad source code
bad source code
Status: CLOSED UPSTREAM
Product: Red Hat Linux
Classification: Retired
Component: Glide3 (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Alan Cox
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-07-28 14:46 EDT by d.binderman
Modified: 2007-04-18 12:56 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-15 12:16:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description d.binderman 2003-07-28 14:46:27 EDT
Description of problem:


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


How reproducible:


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


Expected results:


Additional info:
Comment 1 d.binderman 2003-07-28 14:48:04 EDT
Hello there,

I have just tried to compile package Glide4-20010520-25 from Redhat 9.0
with compiler flag -Wall.

The compiler said

../../../../swlibs/texus2/lib/nccnnet.c:414: warning: conversion lacks type at
end of format
../../../../swlibs/texus2/lib/nccnnet.c:414: warning: conversion lacks type at
end of format
../../../../swlibs/texus2/lib/nccnnet.c:414: warning: unknown conversion type
character `)' in format
../../../../swlibs/texus2/lib/nccnnet.c:414: warning: conversion lacks type at
end of format
../../../../swlibs/texus2/lib/nccnnet.c:414: warning: conversion lacks type at
end of format
../../../../swlibs/texus2/lib/nccnnet.c:414: warning: unknown conversion type
character `)' in format
../../../../swlibs/texus2/lib/nccnnet.c:414: warning: too many arguments for format
The source code is

        printf("eMax=(%3l%3l%3l)...eAvg=(%3l%3l%3l)\n",
               errG, errR, errB,
               totG/ncolors, totR/ncolors, totB/ncolors
               );

In fact, %l is only a modifier, not a specifier. You might be
better off with something like

        printf("eMax=(%3ld%3ld%3ld)...eAvg=(%3ld%3ld%3ld)\n",
               errG, errR, errB,
               totG/ncolors, totR/ncolors, totB/ncolors
               );

The compiler also said

../../../../h5/glide3/src/g3df.c:479: warning: operation on `tempStr' may be
undefined

The source code is
    while(*tempStr != '\0') *tempStr++ = toupper(*tempStr);

You most certainly will be better off with source code like

    while(*tempStr != '\0')
    {
        *tempStr = toupper(*tempStr);
        ++tempStr;
    }

to avoid undefined behaviour.
Comment 2 Mike A. Harris 2004-06-23 20:12:43 EDT
If you could please submit your patch to the upstream Glide3 project
directly on sourceforge, or email it to Daniel Borca the project
maintainer, he'll likely include it in future Glide3 releases, and
it will trickle into future Red Hat OS distributions as well.

Closing bug as UPSTREAM
Comment 3 Alan Cox 2004-10-15 12:16:45 EDT
Except he forgot to mark it so

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