[IRCServices] Gcc 3 and services.

dreamer at darkness.gr dreamer at darkness.gr
Sat Jul 14 22:35:02 PDT 2001


Greetings all,

Problem:
-------
	Installing gcc 3 i notice a strange behaviour at the services.
The problem is specified at two functions inside misc.c. The functions
are strupper and strlower. The exact problem is at:

char *strupper(char *s)
{
    char *t = s;
    while (*t)
        *t++ = toupper(*t); <-
    return s;
}


According ANSI C spec, "... C expressions can contain side effects,
issues of sequencing are important in expression evaluation." (2.1.2.3)

Results:
-------
The result of this code is to have "random" effects while using services.

Example:
-------
/quote version services.test.irc.gr
11:25 ## Server services.TEST.irc.gr: ircservices-4.5.21 build #1,
compiled Sat Jul 14 23:01:42 EEST 2001

/msg operserv akill add doe at joe.com doe 1

11:15 >> [ operserv ] akill add doe at joe.com doe 1
11:15 - OperServ!services at irc.gr - e@@oe.com added to AKILL list.
11:15 %G% OperServ: Dinos added an AKILL for e@@oe.com (expires in 30
days)

/msg operserv akill list

11:26 - OperServ!services at irc.gr - e@@oe.com                         doe 1


Solution:
--------
I guess strupper and strlower should be rebuid. For those looking for one
fast solution, i can post one.

If i'm wrong, correct me :)


Regards,
Nick Krassas
Dinos @irc.gr