Re: [PATCH] http: cast result to FILE *

2019-02-04 Thread Dan McGregor
On February 4, 2019 12:10:54 p.m. CST, Junio C Hamano wrote: >Duy Nguyen writes: > >>> The disadvantage, of course, would be that other call sites would >not >>> benefit from a manual auditing whether the argument has side effects >(and >>> thus, whether a macro using the argument multiple time

Re: [PATCH] http: cast result to FILE *

2019-02-04 Thread Junio C Hamano
Duy Nguyen writes: >> The disadvantage, of course, would be that other call sites would not >> benefit from a manual auditing whether the argument has side effects (and >> thus, whether a macro using the argument multiple times would result in >> very unexpected multiple side effects). > > That's

Re: [PATCH] http: cast result to FILE *

2019-02-04 Thread Duy Nguyen
On Mon, Feb 4, 2019 at 6:44 PM Johannes Schindelin wrote: > > Hi Duy, > > On Sat, 2 Feb 2019, Duy Nguyen wrote: > > > On Sat, Feb 2, 2019 at 4:21 AM Junio C Hamano wrote: > > > > > > Dan McGregor writes: > > > > > > > Commit 8dd2e88a92 ("http: support file handles for HTTP_KEEP_ERROR", > > > > 2

Re: [PATCH] http: cast result to FILE *

2019-02-04 Thread Johannes Schindelin
Hi Duy, On Sat, 2 Feb 2019, Duy Nguyen wrote: > On Sat, Feb 2, 2019 at 4:21 AM Junio C Hamano wrote: > > > > Dan McGregor writes: > > > > > Commit 8dd2e88a92 ("http: support file handles for HTTP_KEEP_ERROR", > > > 2019-01-10) introduced an implicit assumption that rewind, fileno, and > > > ffl

Re: [PATCH] http: cast result to FILE *

2019-02-02 Thread Duy Nguyen
On Sat, Feb 2, 2019 at 4:21 AM Junio C Hamano wrote: > > Dan McGregor writes: > > > Commit 8dd2e88a92 ("http: support file handles for HTTP_KEEP_ERROR", > > 2019-01-10) introduced an implicit assumption that rewind, fileno, and > > fflush are functions. At least on FreeBSD fileno is not, and as s

Re: [PATCH] http: cast result to FILE *

2019-02-01 Thread Junio C Hamano
Dan McGregor writes: > Commit 8dd2e88a92 ("http: support file handles for HTTP_KEEP_ERROR", > 2019-01-10) introduced an implicit assumption that rewind, fileno, and > fflush are functions. At least on FreeBSD fileno is not, and as such > passing a void * failed. I am not strongly opposed to this

[PATCH] http: cast result to FILE *

2019-02-01 Thread Dan McGregor
Commit 8dd2e88a92 ("http: support file handles for HTTP_KEEP_ERROR", 2019-01-10) introduced an implicit assumption that rewind, fileno, and fflush are functions. At least on FreeBSD fileno is not, and as such passing a void * failed. Explicitly cast result to a FILE * when using standard functions