Skip to content

RTS source code issues

Tiago Silva <tiagosilva@hush.com> writes: Last night I started looking at the C files used in GHC and noticed these issues [edit: this list now shows only those issues that haven't been fixed yet]:

  • driver/utils/dynwrapper.c:
int main(int argc, char *argv[]) {
    void *p;
    ...
}

void *p is apparently unused, even if the compiler optimizes it away.. you should check if something went missing.

  • rts/RetainerSet.c:
#elif defined(RETAINER_SCHEME_CC)
// Retainer scheme 3: retainer = cost centre
void
printRetainerSetShort(FILE *f, RetainerSet *rs, nat max_length)

{
    char tmp[max_length + 1];
    int size;
    nat j;

}

Unlike the other functions around it, this function does nothing. Its variables are also not unused?

  • rts/win32/IOManager.c:
AddIORequest, AddDelayRequest, AddProcRequest functions

If (!ioMan || !wItem) the functions either return 0 or FALSE, but they don't free wItem before. Is this optimized by the compiler?

Edited by Thomas Miedema
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information