[APPROVE] __cxa_pure_virtual()

Bart Veer bartv@ecoscentric.com
Thu Mar 27 18:57:00 GMT 2003


>>>>> "Jifl" == Jonathan Larmour <jifl@eCosCentric.com> writes:

    Jifl> Bart Veer wrote:
    >> I have just committed a patch to CYGPKG_INFRA to provide an
    >> implementation of __cxa_pure_virtual() that is appropriate for eCos,
    >> overriding the one in libsupc++. 
    >> 
    >> http://sources.redhat.com/ml/ecos-patches/2003-03/msg00209.html

    Jifl> No objection in principle, although I think you could add a
    Jifl> diag_printf after the CYG_FAIL saying the same thing so
    Jifl> there is some potential diagnostic if people don't have
    Jifl> asserts enabled.

    Jifl> Perhaps even
    Jifl> #ifdef CYGDBG_USE_ASSERTS
    Jifl> CYG_FAIL
    Jifl> #else
    Jifl> diag_printf
    Jifl> #endif

No. __cxa_pure_virtual() should never get called. Even when still
debugging, there are very few applications sufficiently broken that
__cxa_pure_virtual() would get called. In non-debug builds we want a
minimal implementation, and having a diag_printf() in there would be a
waste of code space.

Arguably we should go even further and in non-debug builds alias this
to cyg_assert_fail() or some other dummy function, saving a couple
more bytes.

Bart

-- 
Bart Veer                       eCos Configuration Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts



More information about the Ecos-maintainers mailing list