I'm trying to clean up warnings that I'm getting when compiling Blitz++ of the form:
/opt/local/include/blitz/tinyvec2.h:261:35: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
/opt/local/include/blitz/tinyvec2.h:264:43: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
/opt/local/include/blitz/tinyvec2.h:267:40: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
<<etc.>>
From these kinds of member functions (of the TinyVector
class)
T_numtype * restrict data() // line 261
{ return data_; } // data is a member that is an array of data values
const T_numtype * restrict data() const // line 264
{ return data_; }
As far as I can tell I am getting the warnings due to the restrict
keyword. Note: there are macros that should replace the restrict
with __restrict__
(which g++ understands).
I can get rid of the warnings by deleting the keywords; however, since this is supposed to be a high-performance numerical library, I don't want to lose any compiler optimizations that the restrict
keywords are allowing.
What can I do to suppress these warnings without just dropping the restrict
's altogether, and while keeping -Wall
on?