On 11.08.2016 14:39 MacArthur, Ian (Leonardo, UK) wrote:
>> Building the examples gives errors:
>
> Hmm, this is a bit odd, as I was building using mingw64 at home last evening and I thought it worked without errors.
The problem the OP mentioned is in the examples/ folder which is not
built in the normal build process.
Note: I fixed one error (the one reported by the OP) and another warning
in the examples folder in svn r 11870 (1.3) and 11871 (porting).
> Mind you, I'm using svn rather than the tarballs, and I know a lot of these 64-bit Windows "features" have been resolved.
With current gcc (i.e. 6.1) *all* warnings are resolved, be it Windows
(32-bit or 64-bit) or Linux (64-bit). I don't have a Linux 32-bit system
for testing at hand (but I have a VM somewhere), so I can't tell right
now if we get warnings on 32-bit Linux.
Unfortunately I don't have a macOS system (aka Mac OS X) so I can't test
on those.
> Might be worth trying the svn and see how that goes, or at least the most recent weekly, if you do not have svn.
As noted above, current svn would be necessary to see all warnings
fixed, or the next weekly snapshot (tomorrow).
> Strictly speaking, I think the "right" thing to do would be to "correct" howto-add_fd-and-popen.cxx, in that it defines:
>
> void HandleFD(int fd, void *data) {...}
>
> Whereas the "correct" definition would be:
>
> void HandleFD(FL_SOCKET fd, void *data) {...}
>
> Where FL_SOCKET is meant to resolve to the correct type on each platform.
That's exactly what I did.
But FL_SOCKET is wrong here, as discussed before. Unfortunately that's
how it is in FLTK 1.3. I still hope that we can have a better solution
in FLTK 1.4.
>> Note that there are multiple warnings about int -> pointer
>> casts when bulding FLTK libraries. These should probably
>> have casts added if they are safe.
>
> Again, I think a lot (though probably not yet all...) of these are resolved in svn.
See above. AFAICT all warnings are fixed in gcc builds.
> It's an ongoing battle. When they switched to 64-bit, MS decided to peg a "long" at 32-bit to match an "int", as it always had been in 32-bit Windows.
>
> Everybody else decided to make a "long" 64-bit and leave an "int" as 32-bit.
Yep, there are still lots of warnings in Visual Studio builds under
Windows (32-bit) and even more with 64-bit builds.
Here's a trick: use CMake to build the IDE solution (don't use the
bundled one of FLTK 1.3). When using CMake, set
OPTION_OPTIM:STRING="/wd4244 /wd4267 /wd4305 /wd4996 /wd4312 /wd4334
/wd4838"
This disables all warnings I could find. Lots of these warnings are
related to variable (value) truncation, but there are also these
warnings about "Posix compatible" functions: _open instead of open etc.
I'm aware that this does not _fix_ the warnings, but I'm not going to
"fix" any of these in FLTK 1.3. Maybe in 1.4? Volunteers?