From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH] util/grub-gen-asciih: fix build warning->error
Date: Sat, 21 Jun 2014 20:27:31 +0200 [thread overview]
Message-ID: <53A5CE93.40703@gmail.com> (raw)
In-Reply-To: <1401282382-9806-1-git-send-email-trevor.woerner@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 1484 bytes --]
On 28.05.2014 15:06, Trevor Woerner wrote:
> Using a GCC 4.8.1 cross-compiler for ARM a "may be used uninitialized in this
> function" warning is generated which is converted to an error via -Werror.
> This patch eliminates the warning by initializing the structure then checking
> it has been filled in correctly after calling add_glyph().
>
Fixed few problems and applied, thanks.
> Signed-off-by: Trevor Woerner <trevor.woerner@linaro.org>
> ---
> util/grub-gen-asciih.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/util/grub-gen-asciih.c b/util/grub-gen-asciih.c
> index e01447a..c143afd 100644
> --- a/util/grub-gen-asciih.c
> +++ b/util/grub-gen-asciih.c
> @@ -131,6 +131,8 @@ write_font_ascii_bitmap (FILE *file, FT_Face face)
> struct grub_glyph_info glyph;
> int char_code;
>
> + memset (&glyph, 0, sizeof(glyph));
> +
> fprintf (file, "/* THIS CHUNK OF BYTES IS AUTOMATICALLY GENERATED */\n");
> fprintf (file, "unsigned char ascii_bitmaps[] =\n");
> fprintf (file, "{\n");
> @@ -144,6 +146,12 @@ write_font_ascii_bitmap (FILE *file, FT_Face face)
> return;
> add_glyph (glyph_idx, face, char_code, &glyph);
>
> + if (glyph.bitmap == 0)
> + {
> + fprintf (stderr, "grub-gen-asciih: add_glyph not successful");
> + exit (1);
> + }
> +
> if (glyph.width == 8 && glyph.height == 16
> && glyph.x_ofs == 0 && glyph.y_ofs == 0)
> {
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 274 bytes --]
prev parent reply other threads:[~2014-06-22 1:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-28 13:06 [PATCH] util/grub-gen-asciih: fix build warning->error Trevor Woerner
2014-06-21 18:27 ` Vladimir 'φ-coder/phcoder' Serbinenko [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=53A5CE93.40703@gmail.com \
--to=phcoder@gmail.com \
--cc=grub-devel@gnu.org \
/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;
as well as URLs for NNTP newsgroup(s).