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

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

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>
Group Member
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?)

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?

Patrick Alken <psa>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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)
  •  

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-10-04 gladman StatusNone Wont Fix
        Assigned toNone gladman
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code