Genode::Fifo_element: workaround for compiling with GCC 6

Issue #2383
This commit is contained in:
Christian Prochaska 2017-04-06 17:21:54 +02:00 committed by Christian Helmuth
parent 767d86e6dc
commit 742293ab87

View File

@ -186,6 +186,9 @@ class Genode::Fifo_element : public Fifo<Fifo_element<T> >::Element
* Zero-pointer save: Returns 0 if this pointer is 0 to
* cover the case of accessing an empty FIFO.
*/
/* prevent the compiler from optimizing out the 'this' pointer check */
__attribute__((optimize("-fno-delete-null-pointer-checks")))
inline T *object()
{
if (this) { return _object; }