[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: many tests with XS failing?
From: |
Gavin Smith |
Subject: |
Re: many tests with XS failing? |
Date: |
Fri, 1 Jan 2021 11:13:38 +0000 |
On Sun, Oct 25, 2020 at 10:25 AM Gavin Smith <gavinsmith0123@gmail.com> wrote:
> > parsetexi/api.c: In function ‘element_to_perl_hash’:
> > parsetexi/api.c:429:27: warning: cast from pointer to integer of different
> > size [-Wpointer-to-int-cast]
> > 429 | int value = (int) f;
> > | ^
>
> There's not much chance of an overflow here but to avoid the warnings,
> another integer type could be used instead.
I changed it to a long and IV (a typedef from Perl) instead and the
warnings go away.
long may not be as big as a pointer on MS-Windows but the worse that
is going to happen is compiler warnings. It would in face be very rare
for numbers greater than, like, 5 to be stored in these variables, so
overflow is not a real risk.
There is a intptr_t type in the C standard that is as big as a
pointer, but I don't think we need to worry about it unless there are
more compiler warnings.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: many tests with XS failing?,
Gavin Smith <=