bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] [bug #39403] Visual Studio compiler warnings


From: Patrick Alken
Subject: [Bug-gsl] [bug #39403] Visual Studio compiler warnings
Date: Wed, 03 Jul 2013 09:33:24 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0

URL:
  <http://savannah.gnu.org/bugs/?39403>

                 Summary: Visual Studio compiler warnings
                 Project: GNU Scientific Library
            Submitted by: psa
            Submitted on: Wed 03 Jul 2013 09:33:22 AM GMT
                Category: Build
                Severity: 3 - Normal
        Operating System: 
                  Status: None
             Assigned to: None
             Open/Closed: Open
                 Release: 
         Discussion Lock: Any

    _______________________________________________________

Details:

(reported by Brian Gladman)

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?




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39403>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]