This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Recently introduced typedef void function problem



This problem did not exist in the 20000216 source but is in the
20000324 snapshot and last night's snapshot.  I checked this using
the "compile your program" script at codesourcery.  WOW!! Handy!!

In the following program (cut down from RTEMS), the two conditional
paths used to be treated as equivalent but now first path does not 
work while the second does.  If this is something in C that has changed
recently, I need to know because we use this trick in several places
in RTEMS.

/*
 *  Both ways should work but actually only the second does.
 */

#if 0
typedef void ISR_Handler;
 
typedef ISR_Handler ( *ISR_Handler_entry )();
#else

typedef void ( *ISR_Handler_entry )();
#endif

extern ISR_Handler_entry _ISR_Vector_table[ 0x40 ];
 
void __ISR_Handler(unsigned int vector, void *isr_sp)
{
  if ( _ISR_Vector_table[ vector ] )
   (*_ISR_Vector_table[ vector ])();
}

Thanks.

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]