public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Useless pointer-to-int-cast warning?
@ 2018-08-17 22:27 Vincent Lefevre
  2018-08-17 23:15 ` Jonathan Wakely
  0 siblings, 1 reply; 20+ messages in thread
From: Vincent Lefevre @ 2018-08-17 22:27 UTC (permalink / raw)
  To: gcc-help

What's the point of the pointer-to-int-cast warning, which is
enabled by -Wall?

I get this warning under 32-bit Linux when casting a pointer to
uintmax_t. I use uintmax_t to make sure that the integer size is
large enough. So, what's the problem?

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Useless pointer-to-int-cast warning?
  2018-08-17 22:27 Useless pointer-to-int-cast warning? Vincent Lefevre
@ 2018-08-17 23:15 ` Jonathan Wakely
  2018-08-18  1:22   ` Vincent Lefevre
  0 siblings, 1 reply; 20+ messages in thread
From: Jonathan Wakely @ 2018-08-17 23:15 UTC (permalink / raw)
  To: gcc-help

On Fri, 17 Aug 2018 at 23:27, Vincent Lefevre wrote:
>
> What's the point of the pointer-to-int-cast warning, which is
> enabled by -Wall?
>
> I get this warning under 32-bit Linux when casting a pointer to
> uintmax_t. I use uintmax_t to make sure that the integer size is
> large enough. So, what's the problem?

sizeof(uintmax_t) != sizeof(void*).

Why not use uintptr_t instead?

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Useless pointer-to-int-cast warning?
  2018-08-17 23:15 ` Jonathan Wakely
@ 2018-08-18  1:22   ` Vincent Lefevre
  2018-08-18  1:35     ` Jonathan Wakely
  0 siblings, 1 reply; 20+ messages in thread
From: Vincent Lefevre @ 2018-08-18  1:22 UTC (permalink / raw)
  To: gcc-help

On 2018-08-18 00:14:50 +0100, Jonathan Wakely wrote:
> On Fri, 17 Aug 2018 at 23:27, Vincent Lefevre wrote:
> >
> > What's the point of the pointer-to-int-cast warning, which is
> > enabled by -Wall?
> >
> > I get this warning under 32-bit Linux when casting a pointer to
> > uintmax_t. I use uintmax_t to make sure that the integer size is
> > large enough. So, what's the problem?
> 
> sizeof(uintmax_t) != sizeof(void*).

But why would this make the conversion invalid?

> Why not use uintptr_t instead?

Because this is not portable: "These types are optional."

Another reason is that the code needs to support C90 compilers
(and if uintmax_t is not available, there is a fallback to
unsigned long long, else unsigned long).

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Useless pointer-to-int-cast warning?
  2018-08-18  1:22   ` Vincent Lefevre
@ 2018-08-18  1:35     ` Jonathan Wakely
  2018-08-18  2:31       ` Vincent Lefevre
  2018-08-18  6:02       ` Marc Glisse
  0 siblings, 2 replies; 20+ messages in thread
From: Jonathan Wakely @ 2018-08-18  1:35 UTC (permalink / raw)
  To: gcc-help

On Sat, 18 Aug 2018 at 02:22, Vincent Lefevre <vincent+gcc@vinc17.org> wrote:
>
> On 2018-08-18 00:14:50 +0100, Jonathan Wakely wrote:
> > On Fri, 17 Aug 2018 at 23:27, Vincent Lefevre wrote:
> > >
> > > What's the point of the pointer-to-int-cast warning, which is
> > > enabled by -Wall?
> > >
> > > I get this warning under 32-bit Linux when casting a pointer to
> > > uintmax_t. I use uintmax_t to make sure that the integer size is
> > > large enough. So, what's the problem?
> >
> > sizeof(uintmax_t) != sizeof(void*).
>
> But why would this make the conversion invalid?

The warning doesn't say it's invalid, it says they're different sizes.

I don't know why casting to an integer type that's larger than a
pointer is considered a problem (obviously the other way around is
bad), but you can use -Wno-pointer-to-int-cast if you don't care about
that.

> > Why not use uintptr_t instead?
>
> Because this is not portable: "These types are optional."
>
> Another reason is that the code needs to support C90 compilers
> (and if uintmax_t is not available, there is a fallback to
> unsigned long long, else unsigned long).

So you could try uintptr_t first and if that's not available, try
uintmax_t, then the other fallbacks.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Useless pointer-to-int-cast warning?
  2018-08-18  1:35     ` Jonathan Wakely
@ 2018-08-18  2:31       ` Vincent Lefevre
  2018-08-18  6:02       ` Marc Glisse
  1 sibling, 0 replies; 20+ messages in thread
From: Vincent Lefevre @ 2018-08-18  2:31 UTC (permalink / raw)
  To: gcc-help

On 2018-08-18 02:35:19 +0100, Jonathan Wakely wrote:
> On Sat, 18 Aug 2018 at 02:22, Vincent Lefevre <vincent+gcc@vinc17.org> wrote:
> >
> > On 2018-08-18 00:14:50 +0100, Jonathan Wakely wrote:
> > > On Fri, 17 Aug 2018 at 23:27, Vincent Lefevre wrote:
> > > >
> > > > What's the point of the pointer-to-int-cast warning, which is
> > > > enabled by -Wall?
> > > >
> > > > I get this warning under 32-bit Linux when casting a pointer to
> > > > uintmax_t. I use uintmax_t to make sure that the integer size is
> > > > large enough. So, what's the problem?
> > >
> > > sizeof(uintmax_t) != sizeof(void*).
> >
> > But why would this make the conversion invalid?
> 
> The warning doesn't say it's invalid, it says they're different sizes.

Yes, but I know how to read a manual. :) What I wanted to know
is why there is such a warning for the case where the target
integer type is larger than the pointer type.

> I don't know why casting to an integer type that's larger than a
> pointer is considered a problem (obviously the other way around is
> bad), but you can use -Wno-pointer-to-int-cast if you don't care about
> that.

Yes, this is what I've done, but the (minor) drawback is that
I would no longer get a warning if there is a cast to an integer
type smaller than the pointer type.

> > > Why not use uintptr_t instead?
> >
> > Because this is not portable: "These types are optional."
> >
> > Another reason is that the code needs to support C90 compilers
> > (and if uintmax_t is not available, there is a fallback to
> > unsigned long long, else unsigned long).
> 
> So you could try uintptr_t first and if that's not available, try
> uintmax_t, then the other fallbacks.

But that would make the code uselessly more complicated (another
configure test...).

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Useless pointer-to-int-cast warning?
  2018-08-18  1:35     ` Jonathan Wakely
  2018-08-18  2:31       ` Vincent Lefevre
@ 2018-08-18  6:02       ` Marc Glisse
  2018-08-18 10:00         ` Vincent Lefevre
  1 sibling, 1 reply; 20+ messages in thread
From: Marc Glisse @ 2018-08-18  6:02 UTC (permalink / raw)
  To: gcc-help

On Sat, 18 Aug 2018, Jonathan Wakely wrote:

> On Sat, 18 Aug 2018 at 02:22, Vincent Lefevre <vincent+gcc@vinc17.org> wrote:
>>
>> On 2018-08-18 00:14:50 +0100, Jonathan Wakely wrote:
>>> On Fri, 17 Aug 2018 at 23:27, Vincent Lefevre wrote:
>>>>
>>>> What's the point of the pointer-to-int-cast warning, which is
>>>> enabled by -Wall?
>>>>
>>>> I get this warning under 32-bit Linux when casting a pointer to
>>>> uintmax_t. I use uintmax_t to make sure that the integer size is
>>>> large enough. So, what's the problem?
>>>
>>> sizeof(uintmax_t) != sizeof(void*).
>>
>> But why would this make the conversion invalid?
>
> The warning doesn't say it's invalid, it says they're different sizes.
>
> I don't know why casting to an integer type that's larger than a
> pointer is considered a problem (obviously the other way around is
> bad), but you can use -Wno-pointer-to-int-cast if you don't care about
> that.

I expect it is "bad" because it isn't clear if the value should be 
sign-extended or zero-extended when cast to a larger integer. But that 
doesn't really matter if you are only going to convert it back to a 
pointer, where the extra bits will disappear. It isn't obvious that it 
warrants a warning in -Wall (as opposed to -Wextra or something more 
specialized), but if you are trying to use the extra high bits to stuff 
some extra information, it may matter that they are not 0.

-- 
Marc Glisse

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Useless pointer-to-int-cast warning?
  2018-08-18  6:02       ` Marc Glisse
@ 2018-08-18 10:00         ` Vincent Lefevre
  2018-08-18 19:19           ` Segher Boessenkool
  0 siblings, 1 reply; 20+ messages in thread
From: Vincent Lefevre @ 2018-08-18 10:00 UTC (permalink / raw)
  To: gcc-help

On 2018-08-18 08:01:46 +0200, Marc Glisse wrote:
> I expect it is "bad" because it isn't clear if the value should be
> sign-extended or zero-extended when cast to a larger integer. But that
> doesn't really matter if you are only going to convert it back to a pointer,
> where the extra bits will disappear. It isn't obvious that it warrants a
> warning in -Wall (as opposed to -Wextra or something more specialized), but
> if you are trying to use the extra high bits to stuff some extra
> information, it may matter that they are not 0.

But the C standard says that the behavior is undefined if the result
cannot be represented in the integer type. Thus uintmax_t or intmax_t
is safer than a integer type of the same size of the pointer, in case
the pointer value as an integer would not be representable in this
type, but would be in uintmax_t or intmax_t. So, IMHO, this warning
is just bad.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Useless pointer-to-int-cast warning?
  2018-08-18 10:00         ` Vincent Lefevre
@ 2018-08-18 19:19           ` Segher Boessenkool
  2018-08-20  8:06             ` Vincent Lefevre
  0 siblings, 1 reply; 20+ messages in thread
From: Segher Boessenkool @ 2018-08-18 19:19 UTC (permalink / raw)
  To: gcc-help

On Sat, Aug 18, 2018 at 12:00:07PM +0200, Vincent Lefevre wrote:
> On 2018-08-18 08:01:46 +0200, Marc Glisse wrote:
> > I expect it is "bad" because it isn't clear if the value should be
> > sign-extended or zero-extended when cast to a larger integer. But that
> > doesn't really matter if you are only going to convert it back to a pointer,
> > where the extra bits will disappear. It isn't obvious that it warrants a
> > warning in -Wall (as opposed to -Wextra or something more specialized), but
> > if you are trying to use the extra high bits to stuff some extra
> > information, it may matter that they are not 0.
> 
> But the C standard says that the behavior is undefined if the result
> cannot be represented in the integer type. Thus uintmax_t or intmax_t
> is safer than a integer type of the same size of the pointer, in case
> the pointer value as an integer would not be representable in this
> type, but would be in uintmax_t or intmax_t. So, IMHO, this warning
> is just bad.

Usually cast between a pointer type and a different size integer type
is a programmer mistake.  That is why this warning is enabled by -Wall.

Do you have evidence of many false positives?


Segher

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Useless pointer-to-int-cast warning?
  2018-08-18 19:19           ` Segher Boessenkool
@ 2018-08-20  8:06             ` Vincent Lefevre
  2018-08-20  8:18               ` Jonathan Wakely
  2018-08-20  9:51               ` Segher Boessenkool
  0 siblings, 2 replies; 20+ messages in thread
From: Vincent Lefevre @ 2018-08-20  8:06 UTC (permalink / raw)
  To: gcc-help

On 2018-08-18 14:19:10 -0500, Segher Boessenkool wrote:
> Usually cast between a pointer type and a different size integer type
> is a programmer mistake.  That is why this warning is enabled by -Wall.

I don't see why. In doubt, one should be able to choose the largest
integer type available. Note also that the C standard does not say
that an integer type of the same size as the pointer is sufficient.

> Do you have evidence of many false positives?

False positives when casting to uintmax_t.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Useless pointer-to-int-cast warning?
  2018-08-20  8:06             ` Vincent Lefevre
@ 2018-08-20  8:18               ` Jonathan Wakely
  2018-08-20 14:46                 ` Vincent Lefevre
  2018-08-20  9:51               ` Segher Boessenkool
  1 sibling, 1 reply; 20+ messages in thread
From: Jonathan Wakely @ 2018-08-20  8:18 UTC (permalink / raw)
  To: gcc-help

On Mon, 20 Aug 2018 at 09:07, Vincent Lefevre wrote:
>
> On 2018-08-18 14:19:10 -0500, Segher Boessenkool wrote:
> > Usually cast between a pointer type and a different size integer type
> > is a programmer mistake.  That is why this warning is enabled by -Wall.
>
> I don't see why. In doubt, one should be able to choose the largest
> integer type available. Note also that the C standard does not say
> that an integer type of the same size as the pointer is sufficient.

It says even uintmax_t might not be sufficient. It also says that if
intptr_t and uintptr_t are defined, then they can hold the value of
any void*.

So it seems like you're not actually solving the problem by using
uintmax_t, just reducing it. I still think it's best to use uintptr_t
when available.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Useless pointer-to-int-cast warning?
  2018-08-20  8:06             ` Vincent Lefevre
  2018-08-20  8:18               ` Jonathan Wakely
@ 2018-08-20  9:51               ` Segher Boessenkool
  2018-08-20  9:55                 ` Jonathan Wakely
  2018-08-20 14:50                 ` Vincent Lefevre
  1 sibling, 2 replies; 20+ messages in thread
From: Segher Boessenkool @ 2018-08-20  9:51 UTC (permalink / raw)
  To: gcc-help

Hi,

On Mon, Aug 20, 2018 at 10:05:57AM +0200, Vincent Lefevre wrote:
> On 2018-08-18 14:19:10 -0500, Segher Boessenkool wrote:
> > Usually cast between a pointer type and a different size integer type
> > is a programmer mistake.  That is why this warning is enabled by -Wall.
> 
> I don't see why. In doubt, one should be able to choose the largest
> integer type available. Note also that the C standard does not say
> that an integer type of the same size as the pointer is sufficient.

In the infrequent case where you do want to cast a pointer to an integer
and back, you should use uintptr_t.  It's what it is there for!

("But it is optional!"  It is required by susv3, most systems have it).

> > Do you have evidence of many false positives?
> 
> False positives when casting to uintmax_t.

That's not what I asked: do people actually see many false positives?
If that was true, bugzilla should be filled with it by now.


Segher

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Useless pointer-to-int-cast warning?
  2018-08-20  9:51               ` Segher Boessenkool
@ 2018-08-20  9:55                 ` Jonathan Wakely
  2018-08-20 14:50                 ` Vincent Lefevre
  1 sibling, 0 replies; 20+ messages in thread
From: Jonathan Wakely @ 2018-08-20  9:55 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-help

On Mon, 20 Aug 2018 at 10:51, Segher Boessenkool wrote:
> In the infrequent case where you do want to cast a pointer to an integer
> and back, you should use uintptr_t.  It's what it is there for!
>
> ("But it is optional!"  It is required by susv3, most systems have it).

And for unlikely systems which don't have it, there's no guarantee
that uintmax_t can represent all pointer values either. If uintmax_t
could hold all the values of a pointer, I'd expect the system to do:

typedef uintmax_t uintptr_t;

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Useless pointer-to-int-cast warning?
  2018-08-20  8:18               ` Jonathan Wakely
@ 2018-08-20 14:46                 ` Vincent Lefevre
  2018-08-20 14:52                   ` Jonathan Wakely
  2018-08-24 17:18                   ` NightStrike
  0 siblings, 2 replies; 20+ messages in thread
From: Vincent Lefevre @ 2018-08-20 14:46 UTC (permalink / raw)
  To: gcc-help

On 2018-08-20 09:17:11 +0100, Jonathan Wakely wrote:
> It says even uintmax_t might not be sufficient. It also says that if
> intptr_t and uintptr_t are defined, then they can hold the value of
> any void*.
> 
> So it seems like you're not actually solving the problem by using
> uintmax_t, just reducing it.

If uintmax_t doesn't work, the problem isn't really solvable.

> I still think it's best to use uintptr_t when available.

The issue is that it is not always available. And if it is, then
uintmax_t is guaranteed to be at least as large by definition,
so that uintmax_t will necessarily work.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Useless pointer-to-int-cast warning?
  2018-08-20  9:51               ` Segher Boessenkool
  2018-08-20  9:55                 ` Jonathan Wakely
@ 2018-08-20 14:50                 ` Vincent Lefevre
  1 sibling, 0 replies; 20+ messages in thread
From: Vincent Lefevre @ 2018-08-20 14:50 UTC (permalink / raw)
  To: gcc-help

On 2018-08-20 04:46:11 -0500, Segher Boessenkool wrote:
> ("But it is optional!"  It is required by susv3, most systems have it).

The code needs to support MS Windows, and in particular MSVC.

> > > Do you have evidence of many false positives?
> > 
> > False positives when casting to uintmax_t.
> 
> That's not what I asked: do people actually see many false positives?

*All* warnings I got were false positives.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Useless pointer-to-int-cast warning?
  2018-08-20 14:46                 ` Vincent Lefevre
@ 2018-08-20 14:52                   ` Jonathan Wakely
  2018-08-20 15:16                     ` Vincent Lefevre
  2018-08-24 17:18                   ` NightStrike
  1 sibling, 1 reply; 20+ messages in thread
From: Jonathan Wakely @ 2018-08-20 14:52 UTC (permalink / raw)
  To: gcc-help

On Mon, 20 Aug 2018 at 15:46, Vincent Lefevre <vincent+gcc@vinc17.org> wrote:
>
> On 2018-08-20 09:17:11 +0100, Jonathan Wakely wrote:
> > It says even uintmax_t might not be sufficient. It also says that if
> > intptr_t and uintptr_t are defined, then they can hold the value of
> > any void*.
> >
> > So it seems like you're not actually solving the problem by using
> > uintmax_t, just reducing it.
>
> If uintmax_t doesn't work, the problem isn't really solvable.

And since I can't imagine an implementation where uintmax_t works but
uintptr_t is not defined, I am generalising that to "If uintptr_t is
not defined, the problem isn't really solvable".

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Useless pointer-to-int-cast warning?
  2018-08-20 14:52                   ` Jonathan Wakely
@ 2018-08-20 15:16                     ` Vincent Lefevre
  0 siblings, 0 replies; 20+ messages in thread
From: Vincent Lefevre @ 2018-08-20 15:16 UTC (permalink / raw)
  To: gcc-help

On 2018-08-20 15:52:03 +0100, Jonathan Wakely wrote:
> And since I can't imagine an implementation where uintmax_t works but
> uintptr_t is not defined, I am generalising that to "If uintptr_t is
> not defined, the problem isn't really solvable".

The problem is that the use of uintptr_t uselessly makes the code
more complex. Really, I don't mind whether uintptr_t is defined or
not, but the code must compile.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Useless pointer-to-int-cast warning?
  2018-08-20 14:46                 ` Vincent Lefevre
  2018-08-20 14:52                   ` Jonathan Wakely
@ 2018-08-24 17:18                   ` NightStrike
  2018-09-03 11:47                     ` Vincent Lefevre
  2018-09-03 12:50                     ` Florian Weimer
  1 sibling, 2 replies; 20+ messages in thread
From: NightStrike @ 2018-08-24 17:18 UTC (permalink / raw)
  To: gcc-help

On Mon, Aug 20, 2018 at 10:46 AM Vincent Lefevre <vincent+gcc@vinc17.org> wrote:
>
> On 2018-08-20 09:17:11 +0100, Jonathan Wakely wrote:
> > It says even uintmax_t might not be sufficient. It also says that if
> > intptr_t and uintptr_t are defined, then they can hold the value of
> > any void*.
> >
> > So it seems like you're not actually solving the problem by using
> > uintmax_t, just reducing it.
>
> If uintmax_t doesn't work, the problem isn't really solvable.
>
> > I still think it's best to use uintptr_t when available.
>
> The issue is that it is not always available. And if it is, then
> uintmax_t is guaranteed to be at least as large by definition,
> so that uintmax_t will necessarily work.

On what system do you have uintmax_t but not uintptr_t?  Is there one,
or is this just conjecture?

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Useless pointer-to-int-cast warning?
  2018-08-24 17:18                   ` NightStrike
@ 2018-09-03 11:47                     ` Vincent Lefevre
  2018-09-03 14:31                       ` Vincent Lefevre
  2018-09-03 12:50                     ` Florian Weimer
  1 sibling, 1 reply; 20+ messages in thread
From: Vincent Lefevre @ 2018-09-03 11:47 UTC (permalink / raw)
  To: gcc-help

On 2018-08-24 13:18:13 -0400, NightStrike wrote:
> On what system do you have uintmax_t but not uintptr_t?  Is there one,
> or is this just conjecture?

I don't know all the possible systems. Since this is allowed by
the C standard, I assume that it's possible. Otherwise, why would
uintptr_t be optional?

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Useless pointer-to-int-cast warning?
  2018-08-24 17:18                   ` NightStrike
  2018-09-03 11:47                     ` Vincent Lefevre
@ 2018-09-03 12:50                     ` Florian Weimer
  1 sibling, 0 replies; 20+ messages in thread
From: Florian Weimer @ 2018-09-03 12:50 UTC (permalink / raw)
  To: NightStrike, gcc-help

On 08/24/2018 07:18 PM, NightStrike wrote:
> On what system do you have uintmax_t but not uintptr_t?  Is there one,
> or is this just conjecture?

I doubt that IBM i supports uintptr_t.  The IBM i documentation site is 
currently broken, so I can't check for sure, though.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Useless pointer-to-int-cast warning?
  2018-09-03 11:47                     ` Vincent Lefevre
@ 2018-09-03 14:31                       ` Vincent Lefevre
  0 siblings, 0 replies; 20+ messages in thread
From: Vincent Lefevre @ 2018-09-03 14:31 UTC (permalink / raw)
  To: gcc-help

On 2018-09-03 13:47:32 +0200, Vincent Lefevre wrote:
> On 2018-08-24 13:18:13 -0400, NightStrike wrote:
> > On what system do you have uintmax_t but not uintptr_t?  Is there one,
> > or is this just conjecture?
> 
> I don't know all the possible systems. Since this is allowed by
> the C standard, I assume that it's possible. Otherwise, why would
> uintptr_t be optional?

I've also found:

  https://bugs.launchpad.net/cuneiform-linux/+bug/781179
  "uintptr_t is not defined under MS VC++ 6"

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2018-09-03 14:31 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-17 22:27 Useless pointer-to-int-cast warning? Vincent Lefevre
2018-08-17 23:15 ` Jonathan Wakely
2018-08-18  1:22   ` Vincent Lefevre
2018-08-18  1:35     ` Jonathan Wakely
2018-08-18  2:31       ` Vincent Lefevre
2018-08-18  6:02       ` Marc Glisse
2018-08-18 10:00         ` Vincent Lefevre
2018-08-18 19:19           ` Segher Boessenkool
2018-08-20  8:06             ` Vincent Lefevre
2018-08-20  8:18               ` Jonathan Wakely
2018-08-20 14:46                 ` Vincent Lefevre
2018-08-20 14:52                   ` Jonathan Wakely
2018-08-20 15:16                     ` Vincent Lefevre
2018-08-24 17:18                   ` NightStrike
2018-09-03 11:47                     ` Vincent Lefevre
2018-09-03 14:31                       ` Vincent Lefevre
2018-09-03 12:50                     ` Florian Weimer
2018-08-20  9:51               ` Segher Boessenkool
2018-08-20  9:55                 ` Jonathan Wakely
2018-08-20 14:50                 ` Vincent Lefevre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).