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

Build error #68

Open
imbillow opened this issue Feb 16, 2023 · 0 comments
Open

Build error #68

imbillow opened this issue Feb 16, 2023 · 0 comments

Comments

@imbillow
Copy link

../kmscon/src/text_pixman.c:135:7: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
                if (!tp->surf[i]) {
                    ^~~~~~~~~~~~
../kmscon/src/text_pixman.c:160:9: note: uninitialized use occurs here
        return ret;
               ^~~
../kmscon/src/text_pixman.c:135:3: note: remove the 'if' if its condition is always false
                if (!tp->surf[i]) {
                ^~~~~~~~~~~~~~~~~~~
../kmscon/src/text_pixman.c:116:9: note: initialize the variable 'ret' to silence this warning
        int ret;
               ^
                = 0
1 error generated.

Maybe some variables needs to be initialized

diff --git a/src/kmscon_conf.c b/src/kmscon_conf.c
index 2f3b151..387b6b0 100644
--- a/src/kmscon_conf.c
+++ b/src/kmscon_conf.c
@@ -732,7 +732,7 @@ int kmscon_conf_new(struct conf_ctx **out)
 		/* Video Options */
 		CONF_OPTION_BOOL_FULL(0, "drm", aftercheck_drm, NULL, NULL, &conf->drm, true),
 		CONF_OPTION_BOOL(0, "hwaccel", &conf->hwaccel, false),
-		CONF_OPTION(0, 0, "gpus", &conf_gpus, NULL, NULL, NULL, &conf->gpus, KMSCON_GPU_ALL),
+		CONF_OPTION(0, 0, "gpus", &conf_gpus, NULL, NULL, NULL, &conf->gpus, (void*)KMSCON_GPU_ALL),
 		CONF_OPTION_STRING(0, "render-engine", &conf->render_engine, NULL),
 
 		/* Font Options */
diff --git a/src/text_pixman.c b/src/text_pixman.c
index 060e1f0..d9a054e 100644
--- a/src/text_pixman.c
+++ b/src/text_pixman.c
@@ -113,7 +113,7 @@ static int alloc_indirect(struct kmscon_text *txt,
 {
 	struct tp_pixman *tp = txt->data;
 	unsigned int s, i, format;
-	int ret;
+	int ret = 0;
 
 	log_info("using blitting engine");
 
diff --git a/src/uterm_drm3d_video.c b/src/uterm_drm3d_video.c
index 2dd3b5a..4da6ed4 100644
--- a/src/uterm_drm3d_video.c
+++ b/src/uterm_drm3d_video.c
@@ -411,7 +411,7 @@ static int video_init(struct uterm_video *video, const char *node)
 	};
 	const char *ext;
 	int ret;
-	EGLint major, minor, n;
+	EGLint major, minor, n = 0;
 	EGLenum api;
 	EGLBoolean b;
 	struct uterm_drm_video *vdrm;
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

1 participant