All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Junio C Hamano <junkio@cox.net>
Cc: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>,
	git@vger.kernel.org
Subject: Re: [ANNOUNCE] GIT 1.0.7
Date: Sat, 07 Jan 2006 12:47:06 -0800	[thread overview]
Message-ID: <43C028CA.8090702@zytor.com> (raw)
In-Reply-To: <7vmzi8mkdi.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano wrote:
> 
> Here is what I am planning to merge into the master/maint.  The
> patch is for maint which does not ship with describe, but the
> problematic path[] can be updated to path[FLEX_ARRAY] as others
> when merging it to the master branch.
> 
> -- >8 --
> Subject: [PATCH] Compilation: zero-length array declaration.
> 
> ISO C99 (and GCC 3.x or later) lets you write a flexible array
> at the end of a structure, like this:
> 
> 	struct frotz {
> 		int xyzzy;
> 		char nitfol[]; /* more */
> 	};
> 
> GCC 2.95 lets you to do this with "char nitfol[0]";
> unfortunately this is not allowed by ISO C90.
> 
> This declares such construct like this:
> 
> 	struct frotz {
> 		int xyzzy;
> 		char nitfol[FLEX_ARRAY]; /* more */
> 	};
> 
> and git-compat-util.h defines FLEX_ARRAY to 0 for gcc 2.95 and
> empty for others.
> 
> Although I have not tried this myself, if you are using a C90 C
> compiler, you should be able to override this with
> CFLAGS=-DFLEX_ARRAY=1 from the command line of "make".
> 

Any reason to not just do:

  	struct frotz {
  		int xyzzy;
  		char nitfol[1]; /* more */
  	};

... which should work on all compilers?

	-hpa

  parent reply	other threads:[~2006-01-07 20:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-07  7:01 [ANNOUNCE] GIT 1.0.7 Junio C Hamano
2006-01-07  8:16 ` YOSHIFUJI Hideaki / 吉藤英明
2006-01-07  8:29   ` David S. Miller
2006-01-07  8:33     ` YOSHIFUJI Hideaki / 吉藤英明
2006-01-07  8:43   ` Junio C Hamano
2006-01-07  9:56     ` Junio C Hamano
2006-01-07 12:12       ` Sergey Vlasov
2006-01-07 18:27         ` Junio C Hamano
2006-01-07 20:47       ` H. Peter Anvin [this message]
2006-01-07 21:12         ` Junio C Hamano
2006-01-07 21:30           ` H. Peter Anvin

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=43C028CA.8090702@zytor.com \
    --to=hpa@zytor.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=yoshfuji@linux-ipv6.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.