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

fix warning: checking address of array #768

Merged
merged 2 commits into from
Dec 15, 2018

Conversation

isghe
Copy link
Contributor

@isghe isghe commented Dec 15, 2018

to avoid:

  CC       bfgminer-adl.o
adl.c:390:17: warning: address of array 'lpInfo[i].strAdapterName' will always evaluate to 'true' [-Wpointer-bool-conversion]
                if (lpInfo[i].strAdapterName)
                ~~  ~~~~~~~~~~^~~~~~~~~~~~~~
1 warning generated.

to avoid:
```
  CC       bfgminer-adl.o
adl.c:390:17: warning: address of array 'lpInfo[i].strAdapterName' will always evaluate to 'true' [-Wpointer-bool-conversion]
                if (lpInfo[i].strAdapterName)
                ~~  ~~~~~~~~~~^~~~~~~~~~~~~~
1 warning generated.
```
@luke-jr
Copy link
Owner

luke-jr commented Dec 15, 2018

if (lpInfo[i].strAdapterName[0])

would probably be better

@isghe isghe force-pushed the fix-warning-checking-address-of-array branch from d590352 to d8c2ca1 Compare December 15, 2018 17:50
@isghe
Copy link
Contributor Author

isghe commented Dec 15, 2018

if (lpInfo[i].strAdapterName[0])

would probably be better

Done; I had to gpus[gpu].name = NULL; because in that case it is a dangling pointer.

@luke-jr luke-jr merged commit 63fe36a into luke-jr:bfgminer Dec 15, 2018
@isghe isghe deleted the fix-warning-checking-address-of-array branch December 15, 2018 21:19
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.

2 participants