On Sun, 2006-03-26 at 09:54 +0200, Wouter van Ooijen wrote: > Is there some known problem with C18 and initialisation of static > variables? The code below should IMHO print two times the same two > values, but it does print 65:56 5B:A0. > > static unsigned char global_static = 0x5B; > void Static_Test( void ){ > static unsigned char local_static = 0xA0; > IrTerm_Send_Char( '\n' ); > IrTerm_Send_Hex_Char( global_static ); > IrTerm_Send_Char( ':' ); > IrTerm_Send_Hex_Char( local_static ); > > global_static = 0x5B; > local_static = 0xA0; > IrTerm_Send_Char( ' ' ); > IrTerm_Send_Hex_Char( global_static ); > IrTerm_Send_Char( ':' ); > IrTerm_Send_Hex_Char( local_static ); > for(;;); > } Stupid question, but are you getting any warnings? TTYL ----------------------------- Herbert's PIC Stuff: http://repatch.dyndns.org:8383/pic_stuff/ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist