tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: EV_SET() better C++ compat with alternative implementations
> The original problem is udata of intptr_t insted of void* (like in
> FreeBSD) and with C++ compilers it's not possible to cast it cleanly to
> intptr_t without alternative approaches.
>
> This keeps breaking C++ users and we need to patch 3rd party code from
> the caller level.
>
> It used to break C ones too, but we have introduced a cast to workaround it.
>
> As we fix it for C ones, I think we should fix it for C++ ones as well.
>
> 3 solutions:
>
> - Keep patching it on caller level for C++
> - Keep inventing workarounds on callee level for C++
> - Change the type of udata to void* in our source code.
>
> Templates and c++ features are difficult as the language is reinventing
> its each decade.
>
> Can we go for changing the udata type to void*? This will make all
> compatibility problems to go away.
I am not sure what the best solution is. If we go adding pragma's
then we can use regular casts and disable the -Wold-style-cast
warning with a pragma. Otherwise you seem to have a working
template-specialization based solution. But as you wrote perhaps
the best solution is to go back to using void * for it, although this
means breaking existing software workarounds.
> Compilers probably apply different warning rules for system headers.
Ah, this is the -Wsystem-headers which we enable in our .mk files.
This $#$%#!$$# was what also disabled the array indexing warnings
in the <ctype.h> macros. In our (NetBSD) opinion, -Wsystem-headers
is a mis-feature designed to work around broken system headers that
can cause poor application space implementations to not cause warnings.
christos
Home |
Main Index |
Thread Index |
Old Index