Re: Strange occurencies in Borland makefile

From: Thomas Arp (t_arp@stofanet.dk)
Date: 06/02/02


I'm trying to help a user of the dg scripts package port it to borland.

For this I downloaded Borlands free compiler, version 5.5, and tried
to compile my working copy, which gives no warnings of any kind when
using gcc. I got a lot of warnings. Also from files I haven't changed.

So I downloaded bpl 21, and the fixed conf.h.win George posted a couple of
weeks ago, and followed the steps in readme.borland - Here's the result;



C:\mud\circle30bpl21\src>make -fmakefile.bcc55
MAKE Version 5.2  Copyright (c) 1987, 2000 Borland
        Bcc32 -P- -c @MAKE0001.@@@
Warning W8008 alias.c 72: Condition is always false in function read_aliases
Warning W8066 alias.c 72: Unreachable code in function read_aliases
Warning W8008 alias.c 100: Condition is always false in function
read_aliases
Warning W8066 alias.c 100: Unreachable code in function read_aliases
<snip of working files>
Warning W8008 ban.c 64: Condition is always false in function load_banned
Warning W8066 ban.c 64: Unreachable code in function load_banned
<snip because you get the picture now>

All the places where this particular warning show up, correspond to a
call to the CREATE macro:

#define CREATE(result, type, number)  do {\
 if ((number) * sizeof(type) <= 0) \
  log("SYSERR: Zero bytes or less requested at %s:%d.",
      __FILE__, __LINE__); \
 if (!((result) = (type *) calloc ((number), sizeof(type)))) \
  { perror("SYSERR: malloc failure"); abort(); } } while(0)

Further investigation proves it to be the condition
 if ((number) * sizeof(type) <= 0) \

that is always false. The error occurs every time 1 is passed as the last
parameter. I have tried changing the macro as follows:

#define CREATE(result, type, number)  do {\
!  if ((number) <= 0) \
     log("SYSERR: Zero bytes or less requested at %s:%d.",
         __FILE__, __LINE__); \
   if (!((result) = (type *) calloc ((number), sizeof(type)))) \
    { perror("SYSERR: malloc failure"); abort(); } } while(0)

but to no avail - same bug occurs.

Anyone got a clue ?

Welcor

Btw - there's a compilation error in db.c, since PATH_MAX isn't defined
in windows.

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT