This is the mail archive of the ecos-maintainers@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [APPROVE] __cxa_pure_virtual()


>>>>> "Jifl" == Jonathan Larmour <jifl at eCosCentric dot 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]