Warn about the use of deprecated env() function

This patch enables warnings if one of the deprecate functions that rely
in the implicit use of the global Genode::env() accessor are called.

For the time being, some places within the base framework continue
to rely on the global function while omitting the warning by calling
'env_deprecated' instead of 'env'.

Issue #1987
This commit is contained in:
Norman Feske
2017-01-09 15:18:49 +01:00
parent 4c7ab07480
commit a7f40b24ca
80 changed files with 360 additions and 178 deletions

View File

@ -41,13 +41,28 @@ class Nic::Session_rpc_object : public Genode::Rpc_object<Session, Session_rpc_o
* buffer of the rx packet stream
* \param ep entry point used for packet-stream channels
*/
Session_rpc_object(Genode::Dataspace_capability tx_ds,
Session_rpc_object(Genode::Region_map &rm,
Genode::Dataspace_capability tx_ds,
Genode::Dataspace_capability rx_ds,
Genode::Range_allocator *rx_buffer_alloc,
Genode::Rpc_entrypoint &ep)
:
_tx(tx_ds, *Genode::env()->rm_session(), ep),
_rx(rx_ds, *Genode::env()->rm_session(), *rx_buffer_alloc, ep) { }
_tx(tx_ds, rm, ep),
_rx(rx_ds, rm, *rx_buffer_alloc, ep) { }
/**
* Constructor
*
* \deprecated
* \noapi
*/
Session_rpc_object(Genode::Dataspace_capability tx_ds,
Genode::Dataspace_capability rx_ds,
Genode::Range_allocator *rx_buffer_alloc,
Genode::Rpc_entrypoint &ep) __attribute__((deprecated))
:
_tx(tx_ds, *Genode::env_deprecated()->rm_session(), ep),
_rx(rx_ds, *Genode::env_deprecated()->rm_session(), *rx_buffer_alloc, ep) { }
Genode::Capability<Tx> _tx_cap() { return _tx.cap(); }
Genode::Capability<Rx> _rx_cap() { return _rx.cap(); }