[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pdumper on Solaris 10
From: |
Eli Zaretskii |
Subject: |
Re: pdumper on Solaris 10 |
Date: |
Tue, 17 Dec 2024 22:19:14 +0200 |
> Date: Tue, 17 Dec 2024 11:10:45 -0800
> Cc: gerd.moellmann@gmail.com, emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
>
> >>> CC igc.o
> >>> igc.c: In function 'weak_hash_table_entry':
> >>> igc.c:4102:16: warning: cast to pointer from integer of different size
> >>> [-Wint-to-pointer-cast]
> >>> 4102 | client = (mps_addr_t)entry.intptr;
> >>> | ^
> >>> igc.c:4107:16: warning: cast to pointer from integer of different size
> >>> [-Wint-to-pointer-cast]
> >>> 4107 | client = (mps_addr_t)real_ptr;
> >>> | ^
> ...
> >> What's the preferred way of avoiding a compiler warning in this case?
> >> A simple double cast (first to uintptr_t, then to mps_addr_t) should
> >> work, right?
> > I'll defer to Paul (CC'ed), but my personal preference is also to
> > explicitly reset the ignored bits by bitwise AND.
>
> The usual way I avoid such warnings is a single cast of the pointer to
> uintptr_t (or to intptr_t, if the eventual destination is signed).
But then why doesn't the cast to mps_addr_t work to avoid the warning?
mps_addr_t is 'void *', a 32-bit pointer. Is this something specific
to pointers, while casting to a 32-bit integer doesn't trigger the
warnings? If so, what is the rationale for warning about pointers,
but not about integers?
- Re: pdumper on Solaris 10, (continued)
- Re: pdumper on Solaris 10, Eli Zaretskii, 2024/12/11
- Re: pdumper on Solaris 10, Eli Zaretskii, 2024/12/14
- Re: pdumper on Solaris 10, Pip Cet, 2024/12/15
- Re: pdumper on Solaris 10, Eli Zaretskii, 2024/12/15
- Re: pdumper on Solaris 10, Pip Cet, 2024/12/15
- Re: pdumper on Solaris 10, Eli Zaretskii, 2024/12/15
- Re: pdumper on Solaris 10, John ff, 2024/12/15
- Re: pdumper on Solaris 10, Paul Eggert, 2024/12/17
- Re: pdumper on Solaris 10, Pip Cet, 2024/12/17
- Re: pdumper on Solaris 10, Paul Eggert, 2024/12/17
- Re: pdumper on Solaris 10,
Eli Zaretskii <=
- Re: pdumper on Solaris 10, Paul Eggert, 2024/12/17
- Re: pdumper on Solaris 10, Pip Cet, 2024/12/09
- Re: pdumper on Solaris 10, Pip Cet, 2024/12/17
- Re: pdumper on Solaris 10, Eli Zaretskii, 2024/12/17
- Re: pdumper on Solaris 10, Po Lu, 2024/12/17
- Re: pdumper on Solaris 10, Pip Cet, 2024/12/18
- Re: pdumper on Solaris 10, Pip Cet, 2024/12/08
- Re: pdumper on Solaris 10, Po Lu, 2024/12/08
- Re: pdumper on Solaris 10, Po Lu, 2024/12/08
Re: pdumper on Solaris 10, Po Lu, 2024/12/08