On Tuesday 17 January 2012 01:55:45 Case Van Horsen wrote:
> Hi,
> 
> I've compiled Brian's mpir-exp branch with the VS2008 SDK and a
> modified configure.bat/make.bat. I changed the warning level to /W3
> and examined some of the warnings. The first three warnings I examined
> are:
> 
> 1)  mpn_addsub_n is defined to return int but the returned value 'ret'
> is defined as mp_limb_t. Should ret be defined as int and the
> intermediate results from mpn_add/mpn_sub be cast to int?
> 

the addsub can return -1,0 or 1 so a signed mp_limb_t would best , perhaps we 
should
change it to a signed long (win64 signed long long) . We could have it unsigned 
but you would need
the usual if(mpn_addsub(....) <0 ).....   to be writen as if(mpn_addsub(....) 
== -1 )..... and perhaps a cast to mp_limb_t on the -1
As the next version will export addsub we should come to a decision

> 2)  In tdiv_qr_3by2, the fragment "_mask = - (mp_limb_t) ((r1) >=
> _q0)" generates a warning. On two's complement hardware, I think that
> is equivalent to "_mask = (mp_limb_t)( -((r1) >= _q0))" which doesn't
> generate a warning.
> 
> 3)  Is compat.c needed? Specifically, the duplicate definition
> divexact_by_3 causes a warning.
> 

The division functions are a bit of a pain , there are some others that the cl 
script also had to ignore. We will
have to do something at some stage though


> GCC especially is getting more strict in regards to undefined
> behavior. For example, see
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50066
> 
> Is it worth continuing to analyze these warnings?
> 
> Is it a goal for MPIR to compile without warnings? And if so, at what level?
> 
> Regards,
> Case
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"mpir-devel" group.
To post to this group, send email to mpir-devel@googlegroups.com.
To unsubscribe from this group, send email to 
mpir-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/mpir-devel?hl=en.

Reply via email to