Re: gcc 2.9 Warnings

From: George (greerga@CIRCLEMUD.ORG)
Date: 06/17/98


On Wed, 17 Jun 1998, Matt McLaughlin wrote:

>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.

Actually, egcs can be better than gcc, depending on the releases.  Between
gcc 2.8.1 and egcs 1.0.3 I'd say it's a toss up, but egcs has some better
warnings.

>> comm.c:934:warning comparison is always zero  (never got this before but
>> it is obvious)
>
>  yea    a = b;    b prob is always zero

sbyte x;

if (x > 256)
  /* impossible */

That's what the warning is about.

>> 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.

+ extern medit_save_to_disk(int zone);
+ extern redit_setup_new(struct descriptor_data *d);

Notice the missing types there.  It's mostly harmless but I fixed it in the
OasisOLC v1.6b vs bpl13 patch.

>  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

Can't be (1 << 32) either.

>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.

Not quite how it works..

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

(1 << 31) is safe if you make it an unsigned variable but CircleMUD has
them as signed at the moment.

>  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..

It miscompiles GNU LibC 2.

--
George Greer, greerga@circlemud.org | Genius may have its limitations, but
http://patches.van.ml.org/          | stupidity is not thus handicapped.
http://www.van.ml.org/CircleMUD/    |                  -- Elbert Hubbard


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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