Jump to content
Excelsior Forums
DavePritchard

No such obj File + Warning with "eliminated" [SOLVED].

Recommended Posts

Hi,   I am still struggling to get my first module compiled,  to start with I am trying to convert some Topspeed  library modules  written back in the 90's.

The first one is Menus.mod,  the Def file compiles Ok,  I use the Menus module in several programmes , and have eliminated  errors associated with FOR Loops etc,

but now I get the following  file create error,  I  assumed that the compiler would create this if the module compiled Ok.   So has anyone any ideas as to why this error is occurring ?

* [*** 0.00 F424]
* file create error: "obj/Menus.o" no such file
errors  1, warnings 28, lines 1917, time  0.18
[dave@localhost xds]$

----------------------------------------------------------------------

28 Warnings are listed !,       constant condition eliminated ,      redundant code eliminated ,    unreachable code,    possibly used before definition.

The code compiled Ok with Topspeed and worked without bugs, so when I see the word "eliminated"    To me that indicates that the code is not

included and compiled,  but the lines  most certainly are required !.

So what is the effect of these Warnings ?         one procedure from Menus.mod  is listed , with the associated Warnings.

Any help with these issues would be most welcome..    Dave P..

 

PROCEDURE SetDepthWidth;                                    [ ONE OF THE Menus.mod MODULE PROCEDURES  ]
VAR
  ThisX, LastX,
  ThisY, LastY : CARDINAL;

BEGIN
   CurrentItem := 1;
   ChoiceWidth := 1;
   ChoiceDepth := 1;
   CurrentRec  := MenuPtrs^.Choices;

   WHILE CurrentItem <= NumChoices DO
       IF CurrentItem > 1 THEN                                      (* This line = constant condition eliminated,     W902  *)
          CurrentRec := CurrentRec^.Next;                   (* This line = unreachable code,    W311 *)
       END;
       WITH CurrentRec^ DO
          ThisX := xPos;                                                        (* This line = redundant code eliminated ,     W900 *)
          ThisY := yPos;                                                        (* This line = redundant code eliminated,      W900  *)
       END;
       IF CurrentItem = 1 THEN                                     (* This line =   constant condition eliminated,     W902 *)
          LastX := ThisX;
          LastY := ThisY;
      ELSE
           IF ThisX > LastX THEN                                      (* This line = unreachable code   W311, +  possible use before definition  $LastX,     W304 *)
               INC( ChoiceWidth );                                           (* This line = unreachable code *)
               LastX := ThisX;
           END;
           IF ThisY > LastY THEN                                      (* This line = unreachable code   +  possible use before definition     $LastY,     W304 *) 
               INC( ChoiceDepth );                                           (* This line = unreachable code *)
               LastY := ThisY;
          END;
       END;  (* if *)
    END;  (* while *)
END SetDepthWidth;

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

Hi Dave,

XDS requires existing output directory for object files. So ensure that your "obj" directory exists.

These warnings are emitted because your variable "CurrentItem" is always equal to 1 and these conditions are evaluated to TRUE or FALSE at compile time.

Edited by cypok

Share this post


Link to post
Share on other sites

Hi cypok     Many thanks for the reply, I am getting there slowly

There was an obj directory already in p0,  but not in the xds directory,  so I  created one in xds, and Menus.o was created after compiling. So all good there.

Warnings, Woops, in changing some troublesome FOR loops to WHILE loops I left out the need to increment the loop variable,

Now .no errors, no warnings     Wonderful,   Thanks again,

Dave P..
 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×