From: Leif Lindholm <leif.lindholm@arm.com>
To: Andrey Borzenkov <arvidjaar@gmail.com>
Cc: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: Trunk fails to build with -O<anything other than 0>
Date: Thu, 31 Jan 2013 14:04:57 +0000 [thread overview]
Message-ID: <510A7A09.5090307@arm.com> (raw)
In-Reply-To: <20130130234121.69db8dbb@opensuse.site>
On 30/01/13 19:41, Andrey Borzenkov wrote:
> В Wed, 30 Jan 2013 18:32:39 +0000
> Leif Lindholm <leif.lindholm@arm.com> пишет:
>
>> Our Ubuntu (12.04/12.10) build environment defaults configuring with
>> CFLAGS containing -O2. Trunk currently does not build successfully with
>> this on either my ARM platform or my x86_64 desktop.
>
> I wonder why it did not happen before. Apparently, empty locale.h is
> present since 2010-04-10 (rev 2311). Removing it fixes the problem, but
> I presume it should not be empty in the first place.
Thank you - I can confirm that this resolves the "gettext" portion of my
issue.
Combined with the below (not suggested as a patch, simply to display the
issue clearly), trunk now builds with -O2 again.
Regards,
Leif
=== modified file 'grub-core/lib/crypto.c'
--- grub-core/lib/crypto.c 2013-01-11 20:32:42 +0000
+++ grub-core/lib/crypto.c 2013-01-31 13:41:36 +0000
@@ -461,7 +461,8 @@
}
else
tty_changed = 0;
- fgets (buf, buf_size, stdin);
+ if (fgets (buf, buf_size, stdin) == NULL)
+ return 0;
ptr = buf + strlen (buf) - 1;
while (buf <= ptr && (*ptr == '\n' || *ptr == '\r'))
*ptr-- = 0;
=== modified file 'util/ieee1275/ofpath.c'
--- util/ieee1275/ofpath.c 2013-01-13 21:45:16 +0000
+++ util/ieee1275/ofpath.c 2013-01-31 13:49:44 +0000
@@ -143,7 +143,8 @@
size = st.st_size;
of_path = xmalloc (size + MAX_DISK_CAT + 1);
memset(of_path, 0, size + MAX_DISK_CAT + 1);
- read(fd, of_path, size);
+ if (read(fd, of_path, size) < 1)
+ return NULL;
close(fd);
trim_newline(of_path);
@@ -354,7 +355,8 @@
grub_util_error (_("cannot open `%s': %s"), path, strerror (errno));
memset (phy, 0, sizeof (phy));
- read (fd, phy, sizeof (phy));
+ if (read (fd, phy, sizeof (phy)) < 1)
+ grub_util_warn (_("cannot read `%s': %s"), path, strerror (errno));
sscanf (phy, "%d", tgt);
/
Leif
prev parent reply other threads:[~2013-01-31 14:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-30 18:32 Trunk fails to build with -O<anything other than 0> Leif Lindholm
2013-01-30 19:41 ` Andrey Borzenkov
2013-01-31 14:04 ` Leif Lindholm [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=510A7A09.5090307@arm.com \
--to=leif.lindholm@arm.com \
--cc=arvidjaar@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.