On 3 Apr 2004 09:49:41 -0800,
(Lucas Machado)
wrote:
>i'm doing some Linux Kernel hacking for a course i'm currently taking.
>there is a pointer to a struct (struct example_struct *ex_ptr) in a .c
>that i want to access in a system call. i defined a pointer to a
>pointer in the .c:
>
>extern struct example_struct **pointer;
>
>and somewhere in the code i tried:
>
>pointer = &ex_ptr;
>
>and i get this error when trying to compile the kernel:
>
>invalid lvalue in unary `&'
>
>and it points to the line: pointer = &ex_ptr;....any idea why and what
>i should do to fix it?
From what you've posted, all looks fine. Can you show /exactly/ what the
definition of ex_ptr looks like? Whatever ex_ptr is, it doesn't seem to
have an address associated with it. If it were just the wrong type for
"pointer", I'd have expected the message to spell that out. So my guess is
that "ex_ptr" is actually something like a constant, as weird as that
sounds...
-leor
--
Leor Zolman --- BD Software ---
www.bdsoft.com
On-Site Training in C/C++, Java, Perl and Unix
C++ users: Download BD Software's free STL Error Message Decryptor at:
www.bdsoft.com/tools/stlfilt.html