Re: gcc 2.9 Warnings

From: Matt McLaughlin (mattm@SATYRS.ENGR.CSUFRESNO.EDU)
Date: 06/17/98

On Tue, 16 Jun 1998, Chuck Carson wrote:

> Here is what gcc -v says:
> Reading specs from /usr/lib/gcc-lib/alpha-linux/egcs-2.90.29/specs
> gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)

  Hey man.. go download gnu-2.8.1 from sunsite or somethin.. your compiler
probably sucks.  If its not that.. then try installing whatever compiler
you did have in on your last OS.

> comm.c:934:warning comparison is always zero  (never got this before but
> it is obvious)

  yea    a = b;    b prob is always zero

> olc.c:32:warning: type defaults to 'int' in declaration of 'zedit_setup'

  this one is obvious too..  you probably have some printf("%i") or
somethin that is getting changed to whatever type your passing to it.
This is an eaasy fix.. one way is whats called 'typecasting'... the
way it works is this.

  printf("%i", (int) variable);

** Notice **  ---^

Either than or somewhere along the line.. your assignments from var to var
are different

for example..   short int  -> int

  short int     var1;
        int     var2;


  var2 = var1;

 Just an idea to try.

> Do I need to worry about these?? olc.c is untouched by my hands and is
> stock
> version 1.6b

  Naa.. thats why they are called just warnings.  Some compilers are
more picky than others.. especially the newer ones.

> Hmmm. Now sfter looking at this further...
> I am comparing two PRF_FLAGS,
> blah....
> PRF_DISP_MAXMOVE is (1 << 31)

  ok  thats what  2 ^ 31 power.. normally thats to be your endcap where
you can not exceed (1 << 32)  but, there have been cases where when
comparing multiple bitv's and adding the totals.. it exceeds the typedef
of the variable whos values in question are stored.

  So for example.. you might have..   (1 << 30) && (1 << 31) which is
astronomical..  might work fine for   (1 << 3)  && (1 << 31)  .. hope
you follow what im trying to get at here.

  Just remember this.. and try to make life simple.. never go past
(1 << 30) in your case.

unless you revert to that stacker bitv code.. i duno remember.. but
it went like to 128 or somethin.  check the snippit site on versions
of bitv handing or defs.

> Odd,
> I also have a flag PRF_DISP_MAXMANA that is (1 << 32) and it didn't
> produce any
> warnings and works fine.

  Now you could have gotten an overflow which made it look fine.  then
again.. you could have just been using that flag by itself..
i duno what you call it 'masking' or somethin.. taking the addresses
of all the flags.. like i was explaining earlier.. if you have multiple
flags your trying to check or compare.. and it contains the one with
(1 << 32) 90% of the time with my exp. that it doesnt work right.

> Anyone have any experinces with the alphas and gcc 2.9??

  Humm.. that sounds like a beta version.. I have yet to pick that one
up..  did it go from 2.8.1 -> 2.9 ?

  Id really like to stay away from beta releases.. or ones that arnt that
stable.. i know 2.7.3 is really stable.. and works just fine for 97% of
the coders on this channel..

  The only diffs i have found is the extended libs or commands used...
a few modifications to some of the old code.. and condensation as well.
But.. ive actually ran into more problems with versions over 2.7.3

  A lot of packages off the ftp sites just dont like certain things..
like  sigaction or sigjump..  usually tends to not make any of my
downloads of the net compile right or at all.

> Thanks,
> Chuck

  Welcome dude!

B I O - H A Z A R D   I N D U S T R I E S    (c) 1994 -DarkLord

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST