[IRCServices Coding] GCC3

Mark Hetherington mark at ctcp.net
Sun Feb 24 14:32:24 PST 2002


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

-- 
Mark.