bugGNU Scientific Library - Bugs: bug #39403, Visual Studio compiler warnings


You are not allowed to post comments on this tracker with your current authentication level.

bug #39403: Visual Studio compiler warnings

Submitted by:  Patrick Alken <psa>
Submitted on:  Wed 03 Jul 2013 09:33:22 AM UTC  
Category:  Build Severity:  3 - Normal
Operating System:  Status:  Wont Fix
Assigned to:  Brian Gladman <gladman> Open/Closed:  Closed

Fri 04 Oct 2013 09:19:40 PM UTC, comment #1:

Looking at this again, introducing size_t versions of GSL_MIN_INT and GSL_MAX_INT would not be worth the effort since there are many more instances across the GSL code where size_t types are cast to ints. Sorting only those that involve these macros whilst leaving others in place is not going to help a great deal. Hence only the small issue reported in dwt.c is worth pursuing.

Brian Gladman <gladman>
Project MemberIn charge of this item.
Wed 03 Jul 2013 09:33:22 AM UTC, original submission:

(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?)


ntest = (1 << logn);


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:


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:


for use in such situations?

Patrick Alken <psa>
Project Administrator


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by gladman (Posted a comment)
  • -email is unavailable- added by psa (Submitted the item)

    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    Fri 04 Oct 2013 09:19:40 PM UTC gladman StatusNone => Wont Fix
        Assigned toNone => gladman
        Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.3