On Tue, Mar 29, 2016 at 01:04:44PM -0700, Maciej Katafiasz wrote:
> On 29 March 2016 at 07:52, Willy Tarreau <[email protected]> wrote:
> > On Sun, Mar 27, 2016 at 05:41:08PM +0200, Vincent Bernat wrote:
> >> Willy, you always cast for functions returning void*. This is not
> >> needed. For example:
> >>
> >> l = (struct listener *)calloc(1, sizeof(struct listener));
> >>
> >> Could be just:
> >>
> >> l = calloc(1, sizeof(struct listener));
> >
> > I definitely agree.
> 
> Strictly speaking, that is allowed in C, but *not* in C++. Not that I
> personally care in any way about the ability to compile on C++
> compilers, and as far as I'm concerned making life harder for C++-land
> is a good thing. But it might be an issue if someone tries to compile
> HAProxy on a technically C but actually C++ compiler like VC++.

Well normally there are other differences which make C++ compilers hate
our code anyway. I care much more about code correctness (which leads
to improved in-field stability) than experimental porting to foreign
compilers targetting a crippled language. Also the vast majority of
the code already relies on void* being compatible with anything.

Cheers,
Willy


Reply via email to