From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1WpdZL-00047v-BQ for mharc-grub-devel@gnu.org; Wed, 28 May 2014 09:06:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WpdZD-0003wM-7w for grub-devel@gnu.org; Wed, 28 May 2014 09:06:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WpdZ4-0001rB-Lz for grub-devel@gnu.org; Wed, 28 May 2014 09:06:51 -0400 Received: from mail-ie0-f170.google.com ([209.85.223.170]:60237) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WpdZ4-0001r0-Hv for grub-devel@gnu.org; Wed, 28 May 2014 09:06:42 -0400 Received: by mail-ie0-f170.google.com with SMTP id at1so10313426iec.29 for ; Wed, 28 May 2014 06:06:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gkkzB5ksOdCe+IzBAjq3dr/v8Vtkt7+f4QzG3gsIt3E=; b=dDcMMIT0kJ/PYvrD8OHlr9fYu3u0fymG00NdTmlvfX32pHidxZc84Z+cXPMOHP5/3c 3ukmZiWg1Q6dtcPmDSEtN8VkO88nSM2kq48VJoE06/Zz/gwwb11+ZbtHAQpoSFthg67C CjqAeYHvttMxjSHYK3ARUq5WOE62EoC2c/17RDf4/eujBuy+ZNV0wp5Uoss2lIGPOZOd auilcQZlKWwnjz2z45iUz2zOn3iMvVLrYf4W/8i6S9GQxl/0ELkPcfdOrDoagKyGeMvy L0EzXe8m2ckBYd4EznBe0O9ItXvGroqwpu3QCM3C/U4G8G7VB6WYfkKnLXE6iVzZeVEH jCvA== X-Gm-Message-State: ALoCoQnzKwtcyJl4kTWy5BJ/dOO3a09mvxIgFIR4BhKM6fa5sZxGlGhJFPcVqrsdqBqe9vn+S3/E X-Received: by 10.42.27.147 with SMTP id j19mr10601836icc.81.1401282401766; Wed, 28 May 2014 06:06:41 -0700 (PDT) Received: from openSUSE-i7.site (69-165-220-158.dsl.teksavvy.com. [69.165.220.158]) by mx.google.com with ESMTPSA id ri2sm15724384igc.1.2014.05.28.06.06.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 May 2014 06:06:41 -0700 (PDT) From: Trevor Woerner To: grub-devel@gnu.org Subject: [PATCH] util/grub-gen-asciih: fix build warning->error Date: Wed, 28 May 2014 09:06:22 -0400 Message-Id: <1401282382-9806-1-git-send-email-trevor.woerner@linaro.org> X-Mailer: git-send-email 1.9.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.223.170 Cc: patches@linaro.org X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2014 13:06:57 -0000 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(). Signed-off-by: Trevor Woerner --- 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) { -- 1.9.0