Skip to content

Conversation

weitsai
Copy link

@weitsai weitsai commented Aug 1, 2014

每次執行結束都會出現下面訊息, 想請教出現 Error 40 是正常的嗎?

arm-linux-gnueabihf-gcc -c -O1 -Wall -o fib.o fib.s
arm-linux-gnueabihf-gcc -fno-stack-protector -o fibseq fibseq.o fib.o
qemu-arm -L /usr/arm-linux-gnueabihf ./fibseq
Please input a number:30
The fibonacci sequence at 30 is: 832040
make: *** [qemu] Error 40

@jserv
Copy link
Contributor

jserv commented Aug 1, 2014

Please leave the related messages rather than mix the functional code and questions.

@weitsai
Copy link
Author

weitsai commented Aug 1, 2014

Sorry, 我已修正, 下面是本來的錯誤訊息.

arm-linux-gnueabihf-gcc -c -O1 -Wall -o fibseq.o fibseq.c
fibseq.c: In function ‘main’:
fibseq.c:11:8: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&number);
        ^
fibseq.c:14:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
arm-linux-gnueabihf-gcc -c -O1 -Wall -o fib.o fib.s
arm-linux-gnueabihf-gcc -fno-stack-protector -o fibseq fibseq.o fib.o
qemu-arm -L /usr/arm-linux-gnueabihf ./fibseq
Please input a number:10
The fibonacci sequence at 10 is: 55
make: *** [qemu] Error 36

@jserv
Copy link
Contributor

jserv commented Aug 1, 2014

Fixed in latest GIT. You can perform git rebase.

@weitsai
Copy link
Author

weitsai commented Aug 1, 2014

已經使用 git rebase 把 fix 部分合併

@Eddy0402
Copy link

Eddy0402 commented Aug 4, 2014

這應該是main function沒有return的關係吧
補上return 0或是以c99模式編譯就沒有這個error了

@weitsai
Copy link
Author

weitsai commented Aug 4, 2014

@Eddy0402 yes, 前面已經修正了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants