[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] Re: AVR-libc-dev Digest, Vol 22, Issue 22
From: |
Geoffrey Wossum |
Subject: |
Re: [avr-libc-dev] Re: AVR-libc-dev Digest, Vol 22, Issue 22 |
Date: |
Thu, 30 Sep 2004 18:02:35 -0500 |
User-agent: |
KMail/1.7 |
On Thursday 30 September 2004 5:40 pm, Bill Somerville wrote:
> I think that if extern inline is used then we must provide a non-inline
> function in the library in case someone finds a good reason to take the
> address of the inline fn's which is legal (just).
But they're currently macros. You can't take the address of a macro. Well,
if the macro resolves to something you can take a pointer of, then yes, you
can take a pointer to what the macro resolves to. However, since the macros
we're talking about here are code blocks (which is why we're having this
discussion in the first place), you can't take the address of them. So
nobody's taking a pointer to them right now.
I have sortof done the function pointer thing you speak of with these macros.
I have a routine that can read memory and check it's validity with a CRC-16.
I pass a function pointer to it. I can then either pass a function to read
from the internal flash or an external I2C E2. I had a thin wrapper function
to read out the flash. However, in my case I was doing this in bootloader,
so it wasn't linking against avr-libc anyway, just using the headers.
---
Geoffrey Wossum
Long Range Systems - http://www.pager.net