Thomas Ward <[EMAIL PROTECTED]> wrote:
> #pragma section "section1"
I considered something like that. The reasons against it were:
1. It would have required adding some kludgy code to GCC.
2. It would increase the chances of different translation units seeing
different sections for a function, which leads to instant death with
the current implementation. For example, one .c file could say
#pragma section "whatever"
#include "othermodule.h"
thus seeing different sections compared to other .c files which may
include othermodule.h. There is also the problem of forgetting to
turn off the special sectioning.
3. As I'm sure everyone is aware by now :-), annotating source code
isn't the best thing, and we hope it'll be superceded by something
more automatic.
> void function1(void) __attribute__ ((section ("section1")));
> void function2(void) __attribute__ ((section ("section1")));
I've found that using macros and a good editor make this all less of a
pain in the butt:
/* This aids turning it on and off, etc */
#define SECTION1 __attribute__ ((section ("section1")))
void function1(void) SECTION1;
void function2(void) SECTION1;
Fortunately, you only have to do the bulk of it once.
> all you'd have to do is move the function prototypes to the correct
> location (no actual code changes would be required).
But this *is* a code change, and potentially a bad one because moving
prototypes around can change their visibility and reduce maintainability.
John "oh, and the GCC folks don't believe in #pragma :-)"
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html