linux-origin
[Top] [All Lists]

compiler problem

To: linux-origin@xxxxxxxxxxx
Subject: compiler problem
From: kanoj@xxxxxxxxxxxxxxxxxxx (Kanoj Sarcar)
Date: Tue, 29 Feb 2000 14:46:02 -0800 (PST)
Sender: owner-linux-origin@xxxxxxxxxxx
In arch/ia64/kernel/linux32.c, I added in some piece of code that
_should_ look like this:

static int
nargs(unsigned int arg, char **ap)
{
        char *ptr;
        int n, err;

        n = 0;
        do {
                if ((err = get_user(ptr, (int *)arg)))
                        return(err);
                if (ap)
                        *ap++ = ptr;
                arg += sizeof(unsigned int);
                n++;
        } while(ptr);
        return(n - 1);
}

Unfortunately,compile fails with this code, so I had to
check in:

static int
nargs(unsigned int arg, char **ap)
{
        char *ptr;
        int n, err;

        n = 0;
        for (; ptr; ) {
        do {
                if ((err = get_user(ptr, (int *)arg)))
                        return(err);
                if (ap)
                        *ap++ = ptr;
                arg += sizeof(unsigned int);
                n++;
        }
        return(n - 1);
}

Unfortunately, this does not work all the time, since the 
variable "ptr" is not initialized. If I do initialize it,
I get the same compilation problem. 

This is either a problem with the definition of get_user(),
or the compiler itself. 

If any one has time to look, and get anywhere with it, let me
know ...

Kanoj

<Prev in Thread] Current Thread [Next in Thread>