public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/97614] New: MinGW-w64 pointer to long conversion loses precision error
@ 2020-10-28 9:56 brechtsanders at users dot sourceforge.net
2020-10-28 20:12 ` [Bug analyzer/97614] " dmalcolm at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: brechtsanders at users dot sourceforge.net @ 2020-10-28 9:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97614
Bug ID: 97614
Summary: MinGW-w64 pointer to long conversion loses precision
error
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: analyzer
Assignee: dmalcolm at gcc dot gnu.org
Reporter: brechtsanders at users dot sourceforge.net
Target Milestone: ---
When compiling GCC 11-20201025 with MinGW-w64 I got the following error:
../../gcc/analyzer/store.h: In member function 'hashval_t
ana::symbolic_binding::hash() const':
../../gcc/analyzer/store.h:272:41: error: cast from 'const ana::region*' to
'long int' loses precision [-fpermissive]
272 | return (binding_key::impl_hash () ^ (long)m_region);
| ^~~~~~~~~~~~~~
This is typically caused by the false assumption that pointer and long have the
same size, which is not true on Windows/MinGW.
Usually the solution is to cast to something like intptr_t instead of long.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-28 20:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-28 9:56 [Bug analyzer/97614] New: MinGW-w64 pointer to long conversion loses precision error brechtsanders at users dot sourceforge.net
2020-10-28 20:12 ` [Bug analyzer/97614] " dmalcolm at gcc dot gnu.org
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).