From patchwork Wed May 28 13:06:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Woerner X-Patchwork-Id: 31054 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6901020068 for ; Wed, 28 May 2014 13:06:43 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id tp5sf56232332ieb.5 for ; Wed, 28 May 2014 06:06:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=gkkzB5ksOdCe+IzBAjq3dr/v8Vtkt7+f4QzG3gsIt3E=; b=kiTSUH5GhdWu7gPa1imFR12a9qZ0IrnrD+dcuSQ/EyUMLjB1TIkoBZd6MZLhbqm6/1 dlVWO225FboBUz8Nbnw9H/VG+024Oxe3Ub5FjyX02CPLIGY1eeXLQO/urVxQbwFOpeOh ajY74r8Gx4ZvhjNhMLsqZb7XF3p90uFhpW372V64BJ/lyc3p7CYiNiw06p67nuYnnLYQ 4s833trR9ELGtJBz21T4cdOE8p33MBF3aPJC9RtpDnM0Nq/GIE+q1FvyFD/y+qZi7APn zjL8q72F6NqDs8zyoqsICvz/pNnXaw1EmxbyMN5RQBQ3RFXS7clEM6TCNMiBjJx/6n9p 0svw== X-Gm-Message-State: ALoCoQnQyx36iJcknxM2rQ2URDsfZAPb23SaxcEijvavQb0VMqTgDLj05jGxb7XkrpxDYFPXUESB X-Received: by 10.50.111.15 with SMTP id ie15mr15878969igb.2.1401282402821; Wed, 28 May 2014 06:06:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.103.118 with SMTP id x109ls70218qge.74.gmail; Wed, 28 May 2014 06:06:42 -0700 (PDT) X-Received: by 10.52.185.72 with SMTP id fa8mr28546255vdc.12.1401282402710; Wed, 28 May 2014 06:06:42 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id r6si10448787vdc.10.2014.05.28.06.06.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 May 2014 06:06:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.175 as permitted sender) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id jw12so12448411veb.34 for ; Wed, 28 May 2014 06:06:42 -0700 (PDT) X-Received: by 10.220.44.141 with SMTP id a13mr702253vcf.71.1401282402600; Wed, 28 May 2014 06:06:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp201146vcb; Wed, 28 May 2014 06:06:42 -0700 (PDT) X-Received: by 10.50.79.194 with SMTP id l2mr28665858igx.23.1401282402070; Wed, 28 May 2014 06:06:42 -0700 (PDT) Received: from mail-ig0-f171.google.com (mail-ig0-f171.google.com [209.85.213.171]) by mx.google.com with ESMTPS id d3si12472032igx.10.2014.05.28.06.06.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 May 2014 06:06:42 -0700 (PDT) Received-SPF: pass (google.com: domain of trevor.woerner@linaro.org designates 209.85.213.171 as permitted sender) client-ip=209.85.213.171; Received: by mail-ig0-f171.google.com with SMTP id c1so2365981igq.4 for ; Wed, 28 May 2014 06:06:41 -0700 (PDT) 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 Cc: patches@linaro.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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: trevor.woerner@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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) {