Compilation C program

Hi guys...
Im trying to compile a program written in C..
I am able to compile it to X86, especifically Ubuntu..
But i cant compile it to mips ar71xx architecture..
im using mips-linux-uclibc-gcc cross compiler.

this is the portion of code:
//STAT: LOGIN INFO
    // 3. login info
    i = cs_message_receive(sock, &clicd, buf, sessionkey);
    ticks = GetTickCount()-ticks;
    if (i<=0) {
        close(sock);
        if (tid) pthread_join(tid, NULL);
        pthread_exit();
    }
    if (buf[0]!=MSG_CLIENT_2_SERVER_LOGIN) {
        close(sock);
        if (tid) pthread_join(tid, NULL);
        pthread_exit();
    }
    index = 3;
    // Check username
    struct twin_client_data *usr = cfg.client;
    int found = 0;
    while (usr) {
        if (!strcmp(usr->user,&buf[index])) {
            found=1;
            break;
        }
        usr = usr->next;
    }
    if (!found) {
        buf[0] = MSG_CLIENT_2_SERVER_LOGIN_NAK;
        buf[1] = 0;
        buf[2] = 0;
        cs_message_send(sock, NULL, buf, 3, sessionkey);
        debug("newcamd: unknown user '%s' (%s)\n", &buf[3], ip2string(ip));
        close(sock);
        if (tid) pthread_join(tid, NULL);
        pthread_exit();
    }

i get this error when compiling on uclibc

mips-linux-uclibc-gcc -c -O2 -I. main.c -o main.o
<built-in>:0: note: someone does not honour COPTS correctly, passed 0 times
main.c: In function 'th_cs_connect_cli':
main.c:196: error: too few arguments to function 'pthread_exit'
main.c:201: error: too few arguments to function 'pthread_exit'
main.c:222: error: too few arguments to function 'pthread_exit'
main.c:257: error: too few arguments to function 'pthread_exit'
make[4]: *** [main.o] Error 1

the line 196 correspond to the first pthread_exit() funtion that appears in the code.
Im not very familiar with C programming..
I also waas reading the pthread_exit() usage and i could not clear my doubts..

This is my makefile file:

#CC    = gcc
CXX    = g++
STRIP    = strip
CFLAGS    = -O2 -I.
LFLAGS    = -pthread

OBJECTS = tools.o convert.o debug.o des.o md5crypt.o sockets.o serial.o newcamd.o config.o threads.o main.o

link : $(OBJECTS)
    $(CC) $(LFLAGS) -o twin2cs $(OBJECTS)
.c.o:
    $(CC) -c $(CFLAGS) $< -o $@

clean:
    -rm *.o

BY standard: pthread_exit() requires one argument, it can be NULL.

Sometimes the implementation of a compiler for a given platform can behave in an out-band-way. Change the code & recompile.

Well, in fact i did.. I putted NULL value to the funtion pthread_exit() and it compiled OK
But, when I execute the program it bahaves in a wrong way...
For example: that code upside, correspond to the Log In of the client to the server.
It start the server. Until that point it's OK
Then when a user want to Log in, it rejects all connections, the logic has change..
So, the point think. How could I know how the ubuntu compiler deal with this part?
I mean, what the ubuntu compiler does when it has to compile it? It ommit it? Add a predefined value? Just Ignore?
I tried to see the ubuntu compiler debug, but what i see I did not understand..

The only way to see what is really going on is to look what assembly code is generated by g++ and then use a debugger to step though the code. You can use the gcc/g++ -S option to output assembly code.