📄 bug-221100.c
字号:
/* bug-221100.c If test_index is char, loses high bit when indexes table workaround is to use [(unsigned int) test_index] */#include <testfwk.h>#ifdef __mcs51xdata#endifstatic unsigned inttestArray[130];static unsigned int test_int ; static unsigned char test_index ; static void fetch(void) { test_int = testArray [test_index] ; } static voidtestUnsignedCharIndex(void){ int i; for (i = 0; i < 130; i++) { testArray[i] = i; } test_index = 5; fetch(); ASSERT(test_int == 5); test_index = 129; fetch(); ASSERT(test_int == 129);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -