From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Paul Elder <paul.elder@ideasonboard.com>
Cc: linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] src: gen-image: Fix compiler warning
Date: Fri, 18 Sep 2026 00:07:22 +0300 [thread overview]
Message-ID: <20260917210722.GC24505@killaraus.ideasonboard.com> (raw)
In-Reply-To: <20260917101912.3891324-1-paul.elder@ideasonboard.com>
Hi Paul,
Thank you for the patch.
On Thu, Sep 17, 2026 at 07:19:12PM +0900, Paul Elder wrote:
> Fix compiler warning for maybe uninitialized.
It's useful to record more detailed information when working around
compiler issues. I'll expand the commit message to
gcc reports an uninitialized variable when compiling with '-Os':
In function ‘process’,
inlined from ‘main’ at ../src/gen-image.c:2359:8:
../src/gen-image.c:1722:12: error: ‘image’ may be used uninitialized [-Werror=maybe-uninitialized]
1722 | if (!input) {
| ^
../src/gen-image.c: In function ‘main’:
../src/gen-image.c:389:23: note: ‘image’ was declared here
389 | struct image *image;
| ^~~~~
This appears to be a false positive. Work around it by initializing the
image variable to NULL when declaring it.
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
> src/gen-image.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gen-image.c b/src/gen-image.c
> index 26d7f0d28417..401e1316ae5a 100644
> --- a/src/gen-image.c
> +++ b/src/gen-image.c
> @@ -386,7 +386,7 @@ static int pnm_read_integer(int fd)
>
> static struct image *pnm_read(const char *filename)
> {
> - struct image *image;
> + struct image *image = NULL;
> unsigned int width;
> unsigned int height;
> char buffer[2];
--
Regards,
Laurent Pinchart
prev parent reply other threads:[~2026-09-17 21:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 10:19 [PATCH] src: gen-image: Fix compiler warning Paul Elder
2026-09-17 21:07 ` Laurent Pinchart [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260917210722.GC24505@killaraus.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=paul.elder@ideasonboard.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox