[IRCServices Coding] GCC3

Finny Merrill griever at t2n.org
Sun Feb 24 14:39:38 PST 2002


On Sun, 24 Feb 2002, Mark Hetherington wrote:

> > Finny Merrill wrote:
> > However, it does give two warnings: it says the multi-line string
> > literal in init.c is depreciated (that's true, it's not iso OR posix
> > C) and it says that in do_dropnick, ngi might be used uninitialized
> > (the syntax raises my hackles a bit, but indeed it is always initial-
> > ized when used)
> 
> IIRC the warning about "ngi might be used uninitialised" is not merely a 
> GCC 3.0 error since I have been seeing it for a while. 
> 
> It occurs because of the way the code initialises ngi within an if 
> condition where another condition that must be true is also involved. 
> 
> Personally, I would fix such a warning since it would be a legitimate 
> operation for the compiler to generate code that could skip the 
> initialisation of ngi. 
> 
> The particular line in question is:
> 
> if (ni->nickgroup && !(ngi = get_ngi(ni))) 
> 
> Should ni->nickgroup be zero, the compiler could have output code which 
> would skip the initialisation of ngi since it would not pass an AND 
> operation leading to a later illegal acces to ngi. 

it MUST skip the initialization of ngi if ni->nickgroup compares equal
to 0

> 
>