git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / Atom feed
* [PATCH 0/1] jt/fetch-cdn-offload: fix build with clang
@ 2019-02-24 22:12 Johannes Schindelin via GitGitGadget
  2019-02-24 22:12 ` [PATCH 1/1] fixup! upload-pack: refactor reading of pack-objects out Johannes Schindelin via GitGitGadget
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2019-02-24 22:12 UTC (permalink / raw)
  To: git; +Cc: Jonathan Tan, Junio C Hamano

I think this is actually legitimate a build error (see e.g. 
https://dev.azure.com/gitgitgadget/git/_build/results?buildId=2394), and I
am quite surprised that GCC accepts this.

Note: after thinking about this for a while, I guess an empty string would
work, too (i.e. "" instead of " 0"), but I already waited for the macOS
build to finish at https://github.com/gitgitgadget/git/pull/139, and it's a
fixup! for Jonathan to pick up, anyway...

Junio, could I ask you to apply this on top of your SQUASH??? to fix the
build?

Johannes Schindelin (1):
  fixup! upload-pack: refactor reading of pack-objects out

 upload-pack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 2c31d711669adc7a7bfad06df37b976af99dfaa6
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-139%2Fdscho%2Fjt%2Ffetch-cdn-offload-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-139/dscho/jt/fetch-cdn-offload-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/139
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/1] fixup! upload-pack: refactor reading of pack-objects out
  2019-02-24 22:12 [PATCH 0/1] jt/fetch-cdn-offload: fix build with clang Johannes Schindelin via GitGitGadget
@ 2019-02-24 22:12 ` Johannes Schindelin via GitGitGadget
  2019-03-03  1:21   ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2019-02-24 22:12 UTC (permalink / raw)
  To: git; +Cc: Jonathan Tan, Junio C Hamano, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

This fixes an issue pointed out by clang.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 upload-pack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/upload-pack.c b/upload-pack.c
index 2365b707bc..534e8951a2 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -179,7 +179,7 @@ static void create_pack_file(const struct object_array *have_obj,
 			     const struct string_list *uri_protocols)
 {
 	struct child_process pack_objects = CHILD_PROCESS_INIT;
-	struct output_state output_state = {0};
+	struct output_state output_state = {"\0"};
 	char progress[128];
 	char abort_msg[] = "aborting due to possible repository "
 		"corruption on the remote side.";
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] fixup! upload-pack: refactor reading of pack-objects out
  2019-02-24 22:12 ` [PATCH 1/1] fixup! upload-pack: refactor reading of pack-objects out Johannes Schindelin via GitGitGadget
@ 2019-03-03  1:21   ` Junio C Hamano
  2019-03-03 15:01     ` Johannes Schindelin
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2019-03-03  1:21 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget
  Cc: git, Jonathan Tan, Johannes Schindelin

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> This fixes an issue pointed out by clang.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>  upload-pack.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/upload-pack.c b/upload-pack.c
> index 2365b707bc..534e8951a2 100644
> --- a/upload-pack.c
> +++ b/upload-pack.c
> @@ -179,7 +179,7 @@ static void create_pack_file(const struct object_array *have_obj,
>  			     const struct string_list *uri_protocols)
>  {
>  	struct child_process pack_objects = CHILD_PROCESS_INIT;
> -	struct output_state output_state = {0};
> +	struct output_state output_state = {"\0"};

OK, as the structure looks like

	struct output_state {
		char buffer[8193];
		int used;
		...

we obviously cannot initialize buffer[] with a single integer 0 ;-)
Between "" and "\0" you wondered elsewhere, I have no strong
preference, but if I were fixing it, I would probably write it as

	struct output_state output_state = { { 0 } };

so that readers do not even have to waste time to wonder between the
two.

Thanks.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] fixup! upload-pack: refactor reading of pack-objects out
  2019-03-03  1:21   ` Junio C Hamano
@ 2019-03-03 15:01     ` Johannes Schindelin
  2019-03-11 12:54       ` Johannes Schindelin
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Schindelin @ 2019-03-03 15:01 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin via GitGitGadget, git, Jonathan Tan

Hi,

On Sun, 3 Mar 2019, Junio C Hamano wrote:

> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
> writes:
> 
> > From: Johannes Schindelin <johannes.schindelin@gmx.de>
> >
> > This fixes an issue pointed out by clang.
> >
> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> > ---
> >  upload-pack.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/upload-pack.c b/upload-pack.c
> > index 2365b707bc..534e8951a2 100644
> > --- a/upload-pack.c
> > +++ b/upload-pack.c
> > @@ -179,7 +179,7 @@ static void create_pack_file(const struct object_array *have_obj,
> >  			     const struct string_list *uri_protocols)
> >  {
> >  	struct child_process pack_objects = CHILD_PROCESS_INIT;
> > -	struct output_state output_state = {0};
> > +	struct output_state output_state = {"\0"};
> 
> OK, as the structure looks like
> 
> 	struct output_state {
> 		char buffer[8193];
> 		int used;
> 		...
> 
> we obviously cannot initialize buffer[] with a single integer 0 ;-)
> Between "" and "\0" you wondered elsewhere, I have no strong
> preference, but if I were fixing it, I would probably write it as
> 
> 	struct output_state output_state = { { 0 } };
> 
> so that readers do not even have to waste time to wonder between the
> two.

Right. I don't care, as long as Jonathan addresses the compile error on
clang.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] fixup! upload-pack: refactor reading of pack-objects out
  2019-03-03 15:01     ` Johannes Schindelin
@ 2019-03-11 12:54       ` Johannes Schindelin
  0 siblings, 0 replies; 5+ messages in thread
From: Johannes Schindelin @ 2019-03-11 12:54 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin via GitGitGadget, git, Jonathan Tan

Hi Jonathan,

On Sun, 3 Mar 2019, Johannes Schindelin wrote:

> On Sun, 3 Mar 2019, Junio C Hamano wrote:
> 
> > "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
> > writes:
> > 
> > > From: Johannes Schindelin <johannes.schindelin@gmx.de>
> > >
> > > This fixes an issue pointed out by clang.
> > >
> > > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> > > ---
> > >  upload-pack.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/upload-pack.c b/upload-pack.c
> > > index 2365b707bc..534e8951a2 100644
> > > --- a/upload-pack.c
> > > +++ b/upload-pack.c
> > > @@ -179,7 +179,7 @@ static void create_pack_file(const struct object_array *have_obj,
> > >  			     const struct string_list *uri_protocols)
> > >  {
> > >  	struct child_process pack_objects = CHILD_PROCESS_INIT;
> > > -	struct output_state output_state = {0};
> > > +	struct output_state output_state = {"\0"};
> > 
> > OK, as the structure looks like
> > 
> > 	struct output_state {
> > 		char buffer[8193];
> > 		int used;
> > 		...
> > 
> > we obviously cannot initialize buffer[] with a single integer 0 ;-)
> > Between "" and "\0" you wondered elsewhere, I have no strong
> > preference, but if I were fixing it, I would probably write it as
> > 
> > 	struct output_state output_state = { { 0 } };
> > 
> > so that readers do not even have to waste time to wonder between the
> > two.
> 
> Right. I don't care, as long as Jonathan addresses the compile error on
> clang.

This is *still* broken:
https://dev.azure.com/gitgitgadget/git/_build/results?buildId=4337

Junio, can you please in the least add my fixup! on top of
jt/fetch-cdn-offload?

Thanks,
Dscho

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-03-11 12:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-24 22:12 [PATCH 0/1] jt/fetch-cdn-offload: fix build with clang Johannes Schindelin via GitGitGadget
2019-02-24 22:12 ` [PATCH 1/1] fixup! upload-pack: refactor reading of pack-objects out Johannes Schindelin via GitGitGadget
2019-03-03  1:21   ` Junio C Hamano
2019-03-03 15:01     ` Johannes Schindelin
2019-03-11 12:54       ` Johannes Schindelin

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git