avr-gcc-list
[Top][All Lists]
Advanced

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

RE: [avr-gcc-list] How to get low byte off a function address?


From: Weddington, Eric
Subject: RE: [avr-gcc-list] How to get low byte off a function address?
Date: Sat, 19 Jan 2008 11:04:36 -0700

 

> -----Original Message-----
> From: 
> address@hidden 
> [mailto:address@hidden
> org] On Behalf Of Wouter van Gulik
> Sent: Saturday, January 19, 2008 8:16 AM
> To: address@hidden
> Subject: [avr-gcc-list] How to get low byte off a function address?
> 
> Dear list,
> 
> How do I do this:
> 
> main.c
> =============================================
> void foo(void) {
> }
> 
> char table[2] = {
>     (foo),     
>     (foo),     
> };
> 
> int main(int argc, char* argv[]) 
> {
>       int adr = table[argc]+0x3F00;

FYI, there is a known bug in AVR GCC 4.x about adding an offset to a
function pointer and doing and indirect call:
GCC bug #27192
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27192>

Dr. John Regehr (CCed) is the one that found the bug.

IIRC, 3.4.x did not have this problem.

Eric Weddington




reply via email to

[Prev in Thread] Current Thread [Next in Thread]