This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Recently introduced typedef void function problem
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Recently introduced typedef void function problem
- From: Joel Sherrill <joel dot sherrill at OARcorp dot com>
- Date: Wed, 29 Mar 2000 16:38:17 -0600
- Organization: OAR Corporation
- Reply-To: joel dot sherrill at OARcorp dot com
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