Hi Götz!
Am 04.01.2014 um 18:10 schrieb Götz Hoffart goetz@hoffart.de:
After I read some wondering about gcc 2.8.x and its age in the IRC channel, I thought: now for something really old (at least for Linux): Linux kernel version 1.2.13 and GCC 2.7.2.
GCC 1.x was not that common on Linux system, I'll try that on a SunOS-machine later.
And ngIRCd works!
Good to hear, thanks for testing!
The only problem: the automated tests:
platformtest.sh: Running "make check" ... Oops, test for vsnprintf return code failed!?
Accoring to ISO C99, which defines vsnprintf, it should "return the number of characters that would have been printed if the n were unlimited", and that's what this (quite new) test makes sure.
But the Linux manual page states: "until glibc 2.0.6 they would return -1 when the output was truncated."
So most probably your old Linux installation uses a glibc version that isn't standards conformant -- which ngIRCd depends on in exactly one place (all other callers don't care about the return code). If so, the test is correct and ngIRCd could potentially fail on runtime because of the non-standard return code of vsnprintf() on this system.
Now we can do two things: 1) Nothing. Because this systems glibc is broken. 2) Enhance the test _and_ the one calling function that is affected to handle the broken return code, too.
But after all, I'm quite impressed that my new test code actually found a problem!
Ok, and I wrote a patch for 2), see next mail ... ;-) Could you test it?
If it fixes it: great. And if not, the return code of vsnprintf() would be very interesting, could you add "printf("vsnprintf()=%d\n", r);" below line 149 in the patched src/portab/portabtest.c?
the executable works ("runs") as expected --+ tests run successfully ("make check") --+ | ngIRCd compiles ("make") --+ | | ./configure works --+ | | | | | | |
Platform Compiler ngIRCd Date Tester C M T R *
i686/pc/linux-gnu 2.7.2 21~daily 14-01-04 goetz Y Y N Y 1
I'll add it when we fixed the test suite error ;)
Regards Alex