You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@serf.apache.org by "Branko Čibej (JIRA)" <ji...@apache.org> on 2019/04/30 16:06:00 UTC

[jira] [Comment Edited] (SERF-193) C++ compiler is not started in C mode

    [ https://issues.apache.org/jira/browse/SERF-193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16830428#comment-16830428 ] 

Branko Čibej edited comment on SERF-193 at 4/30/19 4:05 PM:
------------------------------------------------------------

Yes, you can _use_ the Serf API from C\+\+, but you're not really supposed to _compile_ Serf as C++. No, we will _not_ be adding a bunch of casts to calls to {{malloc()}} (or {{apr_p[c]alloc()}}) — that's the only important difference between C and C\+\+ anyway.


was (Author: brane):
Yes, you can _use_ the Serf API from C++, but you're not really supposed to _compile_ Serf as C++. No, we will _not_ be adding a bunch of casts to calls to {{malloc()}} (or {{apr_p[c]alloc()}}) — that's the only important difference between C and C++ anyway.

> C++ compiler is not started in C mode
> -------------------------------------
>
>                 Key: SERF-193
>                 URL: https://issues.apache.org/jira/browse/SERF-193
>             Project: serf
>          Issue Type: Bug
>    Affects Versions: serf-1.3.9
>            Reporter: Michael Osipov
>            Priority: Major
>
> I get the following errors with aCC on HP-UX:
> {noformat}
> /opt/aCC/bin/aCC -o context.o -c -O2 -g -mt -DNDEBUG -DHPUX11 -D_REENTRANT -D_HPUX_SOURCE -D_LARGEFILE64_SOURCE -DSERF_HAVE_GSSAPI -I. -I/opt/ports/include -I/opt/openssl/include context.c
> "context.c", line 40: error #2144: a value of type "void *" cannot be used to
>           initialize an entity of type "serf_context_t *"
>       serf_context_t *ctx = progress_baton;
>                             ^
> "context.c", line 131: error #2144: a value of type "void *" cannot be used to
>           initialize an entity of type "serf_context_t *"
>       serf_context_t *ctx = apr_pcalloc(pool, sizeof(*ctx));
>                             ^
> "context.c", line 142: error #2144: a value of type "void *" cannot be used to
>           initialize an entity of type "serf_pollset_t *"
>           serf_pollset_t *ps = apr_pcalloc(pool, sizeof(*ps));
>                                ^
> "context.c", line 206: error #2144: a value of type "void *" cannot be used to
>           initialize an entity of type "serf_io_baton_t *"
>       serf_io_baton_t *io = serf_baton;
>                             ^
> "context.c", line 303: error #2144: a value of type "void *" cannot be used to
>           initialize an entity of type "serf_io_baton_t *"
>           serf_io_baton_t *io  = desc->client_data;
>                                  ^
> {noformat}
> aCC is a C++ compiler and C++ requires casts on {{malloc()}} and friends. I know that a lot of configure scripts test for {{-Ae}} and this switch is necessary for aCC, likely for other C++ compilers too. I don't know whether this has to be fixed in {{SConstruct}} or scons itself.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)