Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 06-10-2009, 04:19 PM   #1
LQ Newbie
Registered: Dec 2008
Posts: 7

Rep: Reputation: 1
compile error: invalid operands for binary >> for pgd_index(addr) macro

Hi all,
I am writing a driver for a pci device and am trying to translate a virtual address to locate its page table entry using the set of macros in asm/pgtable.h

I am giving a void * to pgd_index(addr) macro to give me a relative position in Page global directory.
But instead while compiling, it gives me an error saying:
error: invalid operands to binary >> (have void * and 'int')

I don't understand what is wrong because as I know, I am supposed to pass a virtual address to the macro to get the pgd index.

Thanks for help.

Old 06-10-2009, 04:36 PM   #2
LQ Newbie
Registered: Dec 2008
Posts: 7

Original Poster
Rep: Reputation: 1
i figured it out. The macro requires an unsigned long to resolve the error. But I dont understand why because the definition of macro says it requires a void pointer.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
invalid operands of types ‘<unresolved overloaded function type>’ and ‘double’ to jus71n742 Programming 2 01-05-2009 01:27 AM
why get compiler error: suffix or operands invalid for 'push' (or 'pop') maxreason Programming 1 08-10-2008 11:42 AM
Error: suffix or operands invalid for `push' in 64 machine arya Linux - General 1 04-19-2007 11:32 AM
what does "prog7.c:11: error: invalid operands to binary %" mean hubabuba Programming 6 11-16-2004 12:13 PM
gcc: invalid operands ajacques Linux - General 1 10-25-2004 08:31 AM

All times are GMT -5. The time now is 07:42 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration