[Bug 1661] Coverage improvements: termios

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Mon Aug 9 13:34:24 UTC 2010


https://www.rtems.org/bugzilla/show_bug.cgi?id=1661

--- Comment #6 from Ralf Corsepius <ralf.corsepius at rtems.org> 2010-08-09 08:34:24 CDT ---
(In reply to comment #5)
> (In reply to comment #4)
> > I am very opposed to "local externs" like this one and consider them to be bad
> > style (They indicate a violation of the API and/or improperly implemented API):
> > 
> > +  
> > +  extern Heap_Control  *RTEMS_Malloc_Heap;
> > +
> >    static const rtems_termios_callbacks Callbacks = {
> >      NULL,                                    /* firstOpen */
> >      NULL,                                    /* lastClose */
> 
> It is an intentional violation of the API.

== Bad and long term unmaintainable code. Consider what will happen if such
symbols change. You will not notice them at compile time, but end up with
silently brokeness or (if you're lucky) with weird linker issues.

> But most of the cases (except
> malloc04) are calling it to just get the amount of free space
> (e.g. malloc_free_space()).  I am testing a patch that should address 
> all but malloc04.
> 
> malloc04 is replacing the malloc heap with another one so it can test the 
> sbrk functionality in the malloc family.  I only see two ways to do this:
> 
> + add it to a .h file
> + add "malloc_get_heap/malloc_set_heap"
> 
> I don't particularly care.  Which do you prefer?
I prefer a proper API, i.e. all "public symbols" in "header files".

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list