[英]C - Eclipse - “Mixed” dialect and ANSI support crash program?
我在Eclipse中遇到了一個奇怪的問題。 右鍵單擊我的項目,然后轉到“屬性”,“ C / C ++構建”,“設置”,“ Gcc C編譯器方言”。 默認情況下,在下拉菜單中,“語言標准”下沒有任何內容,並且我的程序可以正常運行。 但是,通過更改為其他任何內容(C90,C99或C11),程序在運行時會崩潰。
使用調試器,我查看了反匯編,並在某個內存地址收到了關於strln()的投訴,我不確定從哪里開始。
這是一些程序集:
mov (%ecx),%al
add $0x1,%ecx
test %al,%al
je 0x75234434 <strlen+97>
test $0x3,%ecx
jne 0x752343df <strlen+12>
...
有趣的是,在未指定方言的情況下,通過單擊“其他”,然后單擊“支持ANSI程序(-ansi)”,將導致完全相同的錯誤。
任何和所有建議,歡迎:)
跟蹤記錄按要求:
#0 0x752343df in strlen () from C:\WINDOWS\syswow64\msvcrt.dll
#1 0x0044e2bd in __mingw_pformat ()
#2 0x0044ca5f in __mingw_vfprintf ()
#3 0x00417156 in fprintf (__stream=0x752c2980 <msvcrt!_iob+128>, __format=0x4561dc <__register_frame_info+4547036> "%s %.2lf %s %.0lf %.0lf %.2lf %.2lf %.2lf %.2lf ") at c:/mingw/include/stdio.h:246
#4 0x00418893 in skriv_v_profil (tag=0x809fe8, nasta_stat=..., sign=1, variant=2) at ..\src\kortid.c:314
#5 0x00419d65 in kor_tid (tag=0x809fe8, v2=24.25, smax=452, tmax=100000) at ..\src\kortid.c:642
#6 0x00427fdb in gang_tid (tag=0x809fe8, ret_kod=2, tmax=100000, skriv_g3=0, test_finnsg3=0, t_ack=3030.5876288659802) at ..\src\gangtid.c:2617
#7 0x00403215 in kor_tag (taget=0x809fe8, lanken=0x7cc338, riktning=1, result=0x7da1f8, resflg=7) at ..\src\ttt2gtk.c:702
#8 0x00407ff7 in grenkortag (banap=0x28fd6c, grnidx=0, tagtyp=0x7e6ea0, ttpidx=0, riktn=1, resflg=7, stppl=0x0, resp=0x28fd34) at ..\src\ttt2gtk.c:2405
#9 0x004201b8 in main (argc=11, argv=0x7e1b00) at ..\src\gtb.c:991
抱歉,由於窗口很小,我錯過了下半年的復制。
我相信我已經找到了錯誤。 變量之一變為-1,並在Eclipse中突出顯示。 我不知道細節,但我認為解決方案將非常具體,我必須自己找到它。 感謝John Bode和WhozCraig的幫助,尤其是在追溯方面。 救生員,謝謝!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.