[lazarus] Hints in a project can indicate that there is a problem

Pierre Kellerman PierreK at dev.BarloworldOptimus.com
Thu Oct 23 03:21:35 EDT 2003


Hi there to all.

I finally managed to get the source of Lazarus from CVS. ( I am a first
time user of CVS) and compiled in of Windows. with FPC 1.0.10. every
thing went well although i am not as impressed with the windows version
as I am with the Linux version of Lazarus. but still it is a very nice
project.

While running make I released that there is a lot of hints during the
make process. so i did the following

make > make.txt

and then i inspected the make file and looked at the source code that
caused some of this hints.

three of the hints was very early in the output and reverenced the file
graphics.pp in the directory lcl. and stated something like
"Value assigned to red never used"
This seems like a very Innocent message but after investigation of the
code i found that the procedure was declared as follow.

procedure RedGreenBlue(rgb:TColor; Red, Green, Blue : Byte);

and that the code in the procedure assign the deferent parts of the rgb
parameter to Red, Green and Blue respectively. Obviously someone is
using this to split a color into its different parts to inspect or
manipulate the colors individually. But the Red Green and Blue is never
returned and will not have re desired effect. the declaration should be

procedure RedGreenBlue(rgb:TColor; var Red, Green, Blue : Byte);

This is a small change but it get rid of three hints during the make
process. and fix a logical bug in the code.

Now my actual question is. Since I have very limited time to do any
development on or with Lazarus, and have no idea how to make changes to
the source on Lazarus on the CVS system. Can someone please investigate
the hints during the make process and maybe by doing that get rid of a
lot of errors in the code.

By the way the change that I just described must be made on line 1017
and also line 1217 in the graphics.pp file in the lcl directory.

Sorry for the long mail but I wanted to illustrate that compiler hints
in a project can actually be an indicator of a bug.

I always try to create projects that compile with 0 Errors, o Warnings
and 0 Hints. Many people think that Hints is not important. but this
show that they actually are.

Thanks for your Patience in reading this Article :-).






More information about the Lazarus mailing list