Christian Brabandt wrote:
> On Di, 14 Jun 2016, Bram Moolenaar wrote:
>
> >
> > Well, it's computing infinity, so overflow is a bit of an
> > understatement.
>
> Why does only 32bit version complain?
>
> >
> > Perhaps the #ifdef can be adjusted for this compiler and context?
>
> Perhaps disable this specific warning?
> diff -r 07ee18c90e3a src/json.c
> --- a/src/json.c Mon Jun 13 23:00:06 2016 +0200
> +++ b/src/json.c Wed Jun 15 08:59:33 2016 +0200
> @@ -827,6 +827,10 @@
> if (res != NULL)
> {
> res->v_type = VAR_FLOAT;
> + /* disable MS C Compiler Warning only for the next line
> + * 4756: Overflow in constant arithemtic
> + */
> +#pragma warning(suppress:4756)
> res->vval.v_float = INFINITY;
> }
> return OK;
Hmm, if we use INFINITY somewhere else we would need to repeat the
#pragma. I suppose putting it at the #define doesn't work.
We could use a variable and define INFINITY to use that:
# if defined(DBL_MAX)
#pragma here
float_T vim_infinity = DBL_MAX+DBL_MAX;
# define INFINITY vim_infinity
# else
Does that work?
--
Common sense is what tells you that the world is flat.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.