Bug 133757

Summary: pcb-1.6.3-1068: local variable used before set
Product: [openSUSE] SUSE LINUX 10.0 Reporter: David Binderman <dcb314>
Component: BasesystemAssignee: Dr. Werner Fink <werner>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None    
Version: Final   
Target Milestone: ---   
Hardware: All   
OS: SuSE Linux 10.0   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description David Binderman 2005-11-14 21:30:29 UTC
I just tried to compile package pcb-1.6.3-1068 with a prerelease version
of GNU C compiler 4.1.

It said

rats.c:220: warning: "thefp" is used uninitialized in this function

The offending source code is

        FILE                    *thefp;

        MyFree(&command);
        command = EvaluateFilename(Settings.RatCommand, Settings.RatPath, filename, NULL);

                /* open pipe to stdout of command */
        if (*command == '\0' || (thefp = popen(command, "r")) == NULL)
        {
                PopenErrorMessage(command);
        }
                return(thefp);


If *command == '\0', then thefp contains rubbish, which is then returned
to the caller. Suggest initialise local variable "thefp" before first use.

BTW, the address of the author [ Thomas.Nau@rz.uni-ulm.de ] does not seem to work.
Comment 1 Dr. Werner Fink 2005-11-15 10:38:18 UTC
Fixed for next release, see pcb.sf.net
Comment 2 Dr. Werner Fink 2005-11-15 10:38:36 UTC
Fixed