We ran into an interesting problem today. We tried to call the
following rtems_libio functions from a c++ constructor :
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open(iop);
The first and third generated the following errors :
/tcb2/rlc/source/char_available.c:55: returning a value from a constructor
/tcb2/rlc/source/char_available.c:57: returning a value from a constructor
This baffled us for a time until we realized that these two functions
were actually macros that contained returns for failure. We solved the
problem by calling a subroutine that called the two functions. If the
two functions were actually subroutines instead of macros the code would
have compiled.