On 6/11/20 17:49, Richard Shaw wrote:
On Thu, Jun 11, 2020 at 10:43 AM Jan Niklas Hasse
<jhasse(a)bixense.com
<mailto:jhasse@bixense.com>> wrote:
__
On Wed, 10 Jun 2020, at 23:09, Richard Shaw wrote:
> So why does this only show up in MinGW? If a 64bit pointer can't
> find it a 32bit int, shouldn't I also get an error when building
> for 64bit Fedora?
Because ShellExecute is a Windows function, thus that part of the
code won't be compiled when building for 64 bit Linux.
Well, I guess I meant more generally. I "fixed" a bunch of other
"precison" issues for the MinGW build that don't show up in the Fedora
build., one example:
@@ -852,7 +852,7 @@ static void xmlrpc_rig_set_pwrmeter(void *data)
smeter->hide();
pwrmeter->show();
}
- int val = reinterpret_cast<long>(data);
+ int val = reinterpret_cast<intptr_t>(data);
pwrmeter->value(val);
}
Per my google-fu this needed to be changed because long (or int) isn't
guaranteed to be big enough to store a 64bit pointer, but this compiles
without warning on Fedora which is on 10.1.1 and later versions of gcc
tend to be more pedantic but mingw is on 9.2.1.
This is because int and long are different on Windows.
On 64 bit Fedora, the size of int and long are both 64 bit. On 64 bit
Windows, int and long are both 32 bit.
--
Hope this helps,
Kalev