Hey!

My multi-segment application now looks something like this:

void function1(void) __attribute__ ((section ("section1")));
void function2(void) __attribute__ ((section ("section1")));
void function3(void) __attribute__ ((section ("section1")));
...
void function4(void) __attribute__ ((section ("section2")));
void function5(void) __attribute__ ((section ("section2")));
void function6(void) __attribute__ ((section ("section2")));
...
void function7(void) __attribute__ ((section ("section3")));
void function8(void) __attribute__ ((section ("section3")));
void function9(void) __attribute__ ((section ("section3")));

which I'm sure we all agree is somewhat of a pain in the butt. This is
especially true if you end up having to move some code around, since you
then have to also go and change the section names. I was wondering if John
Marshall might be able to comment on the possibility of having some sort of
compiler directive (or SOMETHING), so that we could instead do something
like this:

#pragma section "section1"

void function1(void);
void function2(void);
void function3(void);
...
#pragma section "section2"

void function4(void);
void function5(void);
void function6(void);
...
#pragma section "section3"

void function7(void);
void function8(void);
void function9(void);

where the section pragma would mean, "until I tell you otherwise, put the
following code into the section I'm specifying". This seems to me like it
would be a lot "cleaner" approach. It would also be much easier to modify,
because all you'd have to do is move the function prototypes to the correct
location (no actual code changes would be required).

(Please don't respond to this suggestion with complaints about the syntax
I'm using, or my choice of the word "pragma". That's not the point.)

Anyway, would it be possible to implement something like this?

Tom


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to