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

dlt-system-process-handling: fix warning #12

Merged
merged 1 commit into from
May 18, 2017

Conversation

GordanM
Copy link
Contributor

@GordanM GordanM commented May 15, 2017

In function ‘daemonize’:
dlt-daemon/src/system/dlt-system-process-handling.c:84:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
for(i = getdtablesize(); i >= 0; i--)
^~~
dlt-daemon/src/system/dlt-system-process-handling.c:87:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘for’
int fd = open("/dev/null",O_RDWR);
^~~

Singed-off-by: Gordan Markuš [email protected]

In function ‘daemonize’:
dlt-daemon/src/system/dlt-system-process-handling.c:84:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
     for(i = getdtablesize(); i >= 0; i--)
     ^~~
dlt-daemon/src/system/dlt-system-process-handling.c:87:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘for’
  int fd = open("/dev/null",O_RDWR);
  ^~~

Singed-off-by: Gordan Markuš <[email protected]>
@clipka
Copy link
Contributor

clipka commented May 18, 2017

Hi, somehow the comment does not fit to the changes in source file (there is only one line change - whitespace?)

@GordanM
Copy link
Contributor Author

GordanM commented May 18, 2017

@clipka it is quite a small fix: instead of a tab an indent of 4 spaces is used. This makes all the difference to gcc because it catches the case where the developer would expects the tabbed statement to be inside of the for loop and warns the user of a potential error.

@clipka
Copy link
Contributor

clipka commented May 18, 2017

Thanks for explanation. I did not seen this warning before.

@clipka clipka merged commit 6a8e7c5 into COVESA:master May 18, 2017
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