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

wd: Fix GCC 12 build issue #540

Merged
merged 1 commit into from
Jan 18, 2023
Merged

wd: Fix GCC 12 build issue #540

merged 1 commit into from
Jan 18, 2023

Conversation

gaozhangfei
Copy link
Collaborator

Build errors happen with GCC 12

wd.c: In function 'wd_is_isolate':
wd.c:193:21: error: the comparison will always evaluate as 'true' for the address of 'dev_root' will never be NULL [-Werror=address]
193 | if (!dev || !dev->dev_root)
| ^
In file included from wd.c:21:
./include/wd.h:131:14: note: 'dev_root' declared here
131 | char dev_root[PATH_STR_SIZE];
| ^~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:816: wd.lo] Error 1

Fix by using strlen(dev->dev_root).

Signed-off-by: Thomas Monjalon thomas@monjalon.net
Signed-off-by: Zhangfei Gao zhangfei.gao@linaro.org

Build errors happen with GCC 12

wd.c: In function 'wd_is_isolate':
wd.c:193:21: error: the comparison will always evaluate as 'true' for the address of 'dev_root' will never be NULL [-Werror=address]
  193 |         if (!dev || !dev->dev_root)
        |                     ^
	In file included from wd.c:21:
	./include/wd.h:131:14: note: 'dev_root' declared here
	  131 |         char dev_root[PATH_STR_SIZE];
	        |              ^~~~~~~~
		cc1: all warnings being treated as errors
		make[1]: *** [Makefile:816: wd.lo] Error 1

Fix by using strlen(dev->dev_root).

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
@Liulongfang
Copy link
Collaborator

looks good to me.
+1

@hzhuang1 hzhuang1 merged commit 1202af2 into Linaro:master Jan 18, 2023
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.

None yet

4 participants