Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unchecked return value in diplay_line() in edit.c #7

Open
longr96 opened this issue Feb 24, 2021 · 1 comment
Open

Unchecked return value in diplay_line() in edit.c #7

longr96 opened this issue Feb 24, 2021 · 1 comment

Comments

@longr96
Copy link

longr96 commented Feb 24, 2021

RTEMS (RTEMS.org) is a free single process, multi-threaded real-time operating system with a long history. Your cool editor (edit.c) has been incorporated into RTEMS as one of the shell commands available. The RTEMS Project is a member of the Coverity Scan program and it flagged an issue in this file. In trying to be good citizens of the wider open source community, the project wants these issues to be reported to the upstream owner along with a fix or suggestions. This is one of those reports.

When Coverity Scan was ran on some of your code, a "Unchecked return value" error was found at line 1050 in src/utils/edit/edit.c. For similar errors that we received for RTEMS, we created a macro that will assert the value returned and "use" the return value like so.

int status;

status = get_selection(ed, &selstart, &selend);
assert(status == 0);
(void)status;

You can just use "(void)get_selection()" if you don't care to check the return value of the function call at all, but this is just a suggestion.

@ringgaard
Copy link
Owner

I'm happy that you found the Sanos editor useful in your project. I don't really consider it an error in the Sanos code base to ignore a return value, so while I could fix this in this particular place, there will be many other place in the Sanos code base where I would also need to do this.

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

No branches or pull requests

2 participants