From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 1/3] fsck.gfs2: Fix 'initializer element is not constant' build error
Date: Wed, 28 Jan 2015 08:09:32 -0500 (EST) [thread overview]
Message-ID: <1175730561.2636038.1422450572583.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1422373935-19184-1-git-send-email-anprice@redhat.com>
----- Original Message -----
> This error occurs when gfs2-utils is compiled with -std options more
> recent than gnu89:
>
> CC fsck_gfs2-main.o
> main.c:39:38: error: initializer element is not constant
> struct osi_root dup_blocks = (struct osi_root) { NULL, };
> ^
> main.c:40:35: error: initializer element is not constant
> struct osi_root dirtree = (struct osi_root) { NULL, };
> ^
> main.c:41:37: error: initializer element is not constant
> struct osi_root inodetree = (struct osi_root) { NULL, };
> ^
> As far as I can tell, with C89/gnu89 the use of a cast in this context
> is undefined behaviour and the later standards are more strict about it,
> hence the error. As the standards specify that members of objects with
> static storage duration are zeroed/NULLed anyway, the initializers can
> be removed to achieve the intended result.
>
> Signed-off-by: Andrew Price <anprice@redhat.com>
> ---
ACK
Bob Peterson
Red Hat File Systems
prev parent reply other threads:[~2015-01-28 13:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-27 15:52 [Cluster-devel] [PATCH 1/3] fsck.gfs2: Fix 'initializer element is not constant' build error Andrew Price
2015-01-27 15:52 ` [Cluster-devel] [PATCH 2/3] fsck.gfs2: Simplify bad_journalname Andrew Price
2015-01-28 13:13 ` Bob Peterson
2015-01-28 15:14 ` Andrew Price
2015-01-27 15:52 ` [Cluster-devel] [PATCH 3/3] gfs2-utils build: Add a configure script summary Andrew Price
2015-01-28 13:13 ` Bob Peterson
2015-01-28 13:09 ` Bob Peterson [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=1175730561.2636038.1422450572583.JavaMail.zimbra@redhat.com \
--to=rpeterso@redhat.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 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.