Fix the error reporting problem of runcmd function during compilation… #219
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When I enter make qemu to compile, an error in the runcmd function will be displayed, as shown in the following figure:
![1](https://private-user-images.githubusercontent.com/103946808/296672049-0df45763-60aa-46f8-b42d-eb99706b85a3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2MzA1NzcsIm5iZiI6MTcxOTYzMDI3NywicGF0aCI6Ii8xMDM5NDY4MDgvMjk2NjcyMDQ5LTBkZjQ1NzYzLTYwYWEtNDZmOC1iNDJkLWViOTk3MDZiODVhMy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjI5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYyOVQwMzA0MzdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iYzM2ODY3MTg5N2UzNThhMjFlYTJhMjQzMWUzYzcwYTQ2OThjNzMyODY0NDM1YWFmZDQ5MzM3ZTc5OTU2N2FkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.du3Vm1NAnsoSu84ce15PMY292LNbhRYiWt7w1T1zuTM)
![2](https://private-user-images.githubusercontent.com/103946808/296672464-bee73837-a106-4833-82fa-6de88931ef8d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2MzA1NzcsIm5iZiI6MTcxOTYzMDI3NywicGF0aCI6Ii8xMDM5NDY4MDgvMjk2NjcyNDY0LWJlZTczODM3LWExMDYtNDgzMy04MmZhLTZkZTg4OTMxZWY4ZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjI5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYyOVQwMzA0MzdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kYjZiN2M0MmM0MmRjY2IxODc5NTExM2M1NDJlODUyMmVhOTI1MjQzZjU0NTRiNTU3MjkxZmVmMzcxZjY1MGM1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.oITGdYPrm06RiGGI7fG6HZj2SZd4TrrWc-bfgDZFIjI)
My solution: add attribute((noreturn)) above runcmd in user/sh.c.
Increased compilation effect, successfully entered the terminal after compilation