Re: Passing an address to a #define in C

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Gus,
This is because your code finally ends up with this expression:
(void*)ptr>>  4

and gcc doesn't allow the shift operation to be performed on pointer
types. A possible solution to your problem could be the following code:

For the sake of completeness, if you're wondering why gcc requires an integer type, please check the C standard:

6.5.7 Bitwise shift operators
[...]

Constraints
  Each of the operands shall have integer type.

Best regards,
Andre-Marcel



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux