Source code reusability

Alejandro Villanueva 190921 at cepsz.unizar.es
Tue Oct 24 15:36:22 UTC 2000


Silverio Diquigiovanni wrote:

> Charles-Antoine Gauthier wrote:
>
> > Highly recommended approach. Also, if the timing allows, consider
> > using the RTEMS first level interrupt handler. I would never trust a
> > compiler to do the right thing (e.g. with some systems, address
> > translation may need to be turned back on ASAP). At least, check the
> > generated code for sanity.
>
> Perhaps can be, Alejandro Villanueva suggest another mode
>
> Alejandro Villanueva wrote:
>
> > #define INT_PRAGMA #pragma interrupt
> >
> > INT_PRAGMA
> > void interr( void ) {
> >    printf( "Hi there!" );
> > }
> >
> > int main (void) {
> >    printf( "Main is here!" );
> > }
> > ---------------------------------
> >
> > cpp defines.c > defines.pre
> > cat defines.pre
> > ---------------------------------
> > # 1 "defines.c"
> >
> >
> > #pragma interrupt
> > void interr( void ) {
> >    printf( "Hi there!" );
> > }
> >
> > int main (void) {
> >    printf( "Main is here!" );
> > }
> > ---------------------------------
>
> > I think that once you obtain this file you can compile it with gcc.
>
> Exist a gcc command to induce the prepocessor to do his work two time ?
>
> Thank you !!!

By the way, I compiled the above code with "gcc defines.c" and worked
fine.

To induce the preprocessor to do his work twice just invoke it twice,
first over your .c and second time over your .pre ;-)


--
------------------------------------------------------
¿Quieres Cobrar por Navegar en Internet?
Visita: http://www.navegana.com/dinero/flintstone.html
------------------------------------------------------
Alejandro Villanueva
190921 at cepsz.unizar.es
------------------------------------------------------






More information about the users mailing list