Cliff Jansen commented on PROTON-159:

Note that there are just as many realloc() calls to deal with, including 
indirectly via PN_ENSURE() in util.h.  Is the benefit of embracing compiler 
support of checking types worth extending the macros to this and calloc()?  I'm 
not sure there is an easy way to do this without pulling in std::vector as 
well, which feels heavy handed.

If you like the new PN_ENSURE in the patch, which associates the correct type 
with the realloc, then a middle ground could be to just replace all uses of 
malloc and realloc with something that looks like PN_ENSURE (and calloc with 
PN_ENSUREZ) without the power of two stuff.

At the back of my mind, I was trying to leave the door open for a platform to 
be able to compile a pure C program using the C++ compiler, provided there were 
compiler/linker options to e.g. turn off exception handling or exclude the C++ 
runtime.  I confess I am far from sure this is remotely feasible on any 
platform, but itroducing C++ syntax or C++ Standard Library containers is 
moving in the opposite direction.

In any event, the number of changes are not huge so weigh in on your favorite 
route and I will put it in place.

> port proton to C++
> ------------------
>                 Key: PROTON-159
>                 URL: https://issues.apache.org/jira/browse/PROTON-159
>             Project: Qpid Proton
>          Issue Type: New Feature
>          Components: proton-c
>    Affects Versions: 0.3
>            Reporter: Cliff Jansen
>         Attachments: proton-159-0.diff, proton-159-0-partial.diff
> Make code compile in both C99 and C++, using the gnu toolchain.  This is a 
> necessary first step
> towards a Microsoft Visual Studio port (where the compiler supports C++ but 
> not C99).

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to