Microsoft has just released a preview of Visual Studio 2013 with support
for some C99 features and some further compiler warnings.

GSL compiles and builds fine and the tests pass with VS 2013 but there
are a number of compiler warnings which I feel are worth consideration.

-----------------

In wavelet\dwt.c (line 47): warning C4334: '<<' : result of 32-bit shift
implicitly converted to 64 bits (was 64-bit shift intended?)

Changing

  ntest = (1 << logn);

to

  ntest = ((size_t)1 << logn);

resolves this.  This may not be necessary but it costs nothing.

-----------------

Throughout GSL there are a large number of warnings of this form:

warning C4267: 'function' : conversion from 'size_t' to 'int', possible
loss of data

Many of these are caused by using the inline functions:

GSL_INT_MIN
GSL_INT_MAX

in situations where the input variables and the result are all defined
as size_t.

These are probably benign warnings but the conversions involved are all
sources of potential problems so I wonder whether GSL should have the
inline functions:

GSL_SIZE_T_MIN
GSL_SIZE_T_MAX

for use in such situations?

-----------------

   with regards,

      Brian Gladman

Reply via email to