Namespace collision with system header "/usr/include/bits/termios-c_oflag.h" on Linux

Issue #455 wontfix
John Galbraith created an issue

This prehistoric system header pollutes the namespace for Blaze and disrupts the template definition. It is probably easiest just to choose a different template parameter name in Blaze.

The offender is termios-c_oflag.h with:

#define   VT1   0040000

which breaks Blaze here in blaze/math/blas/axpy.h:65:20:

template< typename VT1, bool TF1, typename VT2, bool TF2, typename ST >
void axpy( DenseVector<VT1,TF1>& x, const DenseVector<VT2,TF2>& y, ST alpha );

The workaround is to just to adjust the order of #includes so Blaze gets included first.

Thank you for the great library.

Comments (1)

  1. Klaus Iglberger

    Hi John!

    Thanks a lot for pointing out this problem. You are correct, the wrong order of includes will break Blaze code. However, Blaze would not break in only one place, but in many places (>100). The template parameter VT1 is used throughout the Blaze library. In addition, we use the names VT2, MT1, MT2, … Since changing the name would cause a lot of effort and would introduce inconsistencies, we will not perform this change. After all, the problem is not in Blaze, but in the use of macros. Although it is inconvenient for you, please continue to pay attention to the order of includes. Still, thanks for pointing out the problem,

    Best regards,

    Klaus!

  2. Log in to comment