[問題] 一段ti ccs編不過的code(己解決)

作者: kdjf (我抓得到什麼呢?)   2015-05-28 14:02:47
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
TI CCS + TI ARM compiler for stellaris or
CCS + gcc arm
(on Windows x86)
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
NONE
問題(Question):
編譯不過
餵入的資料(Input):
NONE
預期的正確結果(Expected Output):
在msvc++2012(x86) /Wall編譯成功沒任何警告
錯誤結果(Wrong Output):
編不過
程式碼(Code):(請善用置底文網頁, 記得排版)
struct WorkFreq{
int freq;
int freq_real;
int time[3];
int intensity;
}; // extracted freq component for DOA analysis
#pragma DATA_ALIGN(dma_ch_table, 1024)
struct {
int* src_endp;
int* dst_endp;
int ctrl;
int not_used;
} dma_ch_table[28]; // 14=adc0_ss0, 24=adc1_ss0
WorkFreq* work_freq = (WorkFreq*)&dma_ch_table;
// size is 14, reuse empty dma structure
補充說明(Supplement):
要給mcu用的,想省一些記憶體,vc編起來也正常,dma[0~13]都不會用到
自學的C/C++,會不會是我碰到了未定義的行為?
作者: GoIt (凍物。)   2015-05-28 14:37:00
typedef?
作者: Feis (永遠睡不著 @@)   2015-05-28 14:58:00
少了分號?
作者: TobyH4cker (Toby (我要當好人))   2015-05-28 16:55:00
WorkFreq並不是type只能typedef我也不確定對
作者: james732 (好人超)   2015-05-28 17:11:00
把WorkFreq改成struct WorkFreq試試?啊,推文已經有寫了

Links booklink

Contact Us: admin [ a t ] ucptt.com