Concerns on windows development using older VS compilers: they have bugs

Message boards : BOINC client : Concerns on windows development using older VS compilers: they have bugs
Message board moderation

To post messages, you must log in.

AuthorMessage
Profile Joseph Stateson
Volunteer tester
Avatar

Send message
Joined: 27 Jun 08
Posts: 641
United States
Message 95609 - Posted: 1 Feb 2020, 16:01:22 UTC
Last modified: 1 Feb 2020, 16:06:21 UTC

Have been reading about changes to Visual Studio after 2013 at various web sites and how the improvements have helped.

I did try once to compile boinc client under VS2017 but gave up as way too many compiler problems. Clearly the software needs to be compatible with several platforms and a lot of different hardware and the newer compilers deviate a lot from Linux compiler.

Want to mention a problem I had a few days ago when using VS2013 with latest patches. AFAICT this is the latest compiler that works with BOINC.

I was using the VS2013 debugger to step through x64 code as I wanted to see what had been read in from the coproc_info.xml file. I had done a "clean" followed by a build all and the program seems to be working just fine.

When stepping through I noticed I was stepping through grayed out code. That should not have happened. Grayed out code is supposed to be excluded. I stopped the debugger to investigate. The code below the "SIM" was grayed out.
#ifndef SIM
// alert user if any jobs need more RAM than available
// (based on RAM estimate, not measured size)
//
static void check_too_large_jobs() {
    unsigned int i, j;
    double m = gstate.max_available_ram();


According to VS2013 intelligence, the macro "SIM" was set to 1. That was not possible as I was not running a simulation and clearly the code was being executed even though it was grayed out..

I added "#undef SIM" right before the "#ifdef SIM" and that cleared up the grayed out text.
Wanting to figure out what was going on and where SIM got set to "1", I started moving my "#undef SIM" higher up in the source code. When got to the following, the grayed out code returned

#endif
#undef SIM
    if (strlen(host_info.virtualbox_version)) {
        msg_printf(NULL, MSG_INFO,
            "VirtualBox version: %s",
            host_info.virtualbox_version
        );
    } else {
#if defined (_WIN32) && !defined(_WIN64)
        if (!strcmp(get_primary_platform(), "windows_x86_64")) {
            msg_printf(NULL, MSG_USER_ALERT,
                "Can't detect VirtualBox because this is a 32-bit version of BOINC; to fix, please install a 64-bit version."
            );
        }
#endif
    }
}
---
lot of code is here
---
#ifndef SIM
// alert user if any jobs need more RAM than available
// (based on RAM estimate, not measured size)
//
static void check_too_large_jobs() {
    unsigned int i, j;
    double m = gstate.max_available_ram();


I got the grayed out code to disappear (back to normal) after moving the #undef SIM down below the following #endif
Somethng was confusing the compiler. I also noticed it took maybe 10-15 seconds** before the VS2013 "grayed" or "ungrayed" any code. I have never seen delays that long, but this is a huge program.

** it was taking 10-15 seconds depending on how far away the #undef SIM was from the #ifdef SIM problem area.

Want to point out that the program compiles just fine, it is just the VS2013 "inteliisense" that was unable to figure out what to color as gray or not.
The next day I looked at this the problem was gone. VS2013 had been closed, and the system had been rebooted after a Microsoft update to win10.
ID: 95609 · Report as offensive

Message boards : BOINC client : Concerns on windows development using older VS compilers: they have bugs

Copyright © 2024 University of California.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.