NO

Author Topic: Version 10.00 (RC3) is now available  (Read 8433 times)

Offline Marco

  • Member
  • *
  • Posts: 42
Re: Version 10.00 (RC3) is now available
« Reply #15 on: July 18, 2020, 12:29:20 PM »
Hello. I've a very old source program that uses the GlobalAllocPtr/GlobalFreePtr macros. When compiled, the compiler shows the following warning:
Code: [Select]
warning #2046: Expression with no effect removed.

The above warning is related to the GlobalFreePtr macro. Here is a very simple example to reproduce the warning:
Code: [Select]
char *buf = (char*) GlobalAllocPtr(GPTR, 2048);
if (buf) {
    lstrcpy(buf, "some text");
    GlobalFreePtr(buf);           // <-- warning #2046
}

If I change both macros with the GlobalAlloc/GlobalFree functions, no warning is shown.

I'm just out of curiosity: why does that warning occur?
 

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Version 10.00 (RC3) is now available
« Reply #16 on: July 18, 2020, 02:09:32 PM »
I'm just out of curiosity: why does that warning occur?
This is an early warning, and it comes from dropping an internal conversion operator created by a type-cast. Pretty unhelpful warning, if you ask me.
If I can find an easy way to silence a warning like this for version 10.0 I will do it, otherwise it will have to wait until the next version.
/Pelle

Offline Marco

  • Member
  • *
  • Posts: 42
Re: Version 10.00 (RC3) is now available
« Reply #17 on: July 18, 2020, 03:14:53 PM »
Thank you for the explanation, Pelle :)

Offline algernon77

  • Member
  • *
  • Posts: 7
Re: Version 10.00 (RC3) is now available
« Reply #18 on: July 20, 2020, 05:49:45 PM »
First of all, thanks for your effort! I'm using it since v7 and liking it a lot!
Seems to build all my old OpenWatcom projects correctly.

I seem to have a couple of issues with the ide, though. One is that I've checked the "Just-in-time debugging"debugger option, and now it's always checked, even if I uncheck it and click OK in the Options dialog (I'm logged with an administrative account on Win7 x64).

The other would be with the functions database of a particular project. It has about 70 functions declared and defined in a single file, but the browser on the right shows only about 15. On other projects with smaller nr. of functions per module (about 20), all seem to be ok. I tried deleting the tag file and rebuilding, but no luck. I'll attach a screenshot below. Am I doing something really outrageous?  :)
« Last Edit: July 20, 2020, 11:46:26 PM by algernon77 »

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Version 10.00 (RC3) is now available
« Reply #19 on: July 21, 2020, 02:28:03 PM »
I seem to have a couple of issues with the ide, though. One is that I've checked the "Just-in-time debugging"debugger option, and now it's always checked, even if I uncheck it and click OK in the Options dialog (I'm logged with an administrative account on Win7 x64).
Hm. I can't reproduce this on my machine. Windows 10, but it shouldn't matter.

The other would be with the functions database of a particular project. It has about 70 functions declared and defined in a single file, but the browser on the right shows only about 15. On other projects with smaller nr. of functions per module (about 20), all seem to be ok. I tried deleting the tag file and rebuilding, but no luck. I'll attach a screenshot below. Am I doing something really outrageous?  :)
The screenshot only contain function prototypes, the project tree will only contain function definitions, but apart from that I can't say very much: not enough information.

The list of functions in the project tree comes from the browse info manager, which is not a full compiler, so there could be something in the syntax that the compiler can handle but not the browse info manager.

If you are comfortable with the command-line, you could try running the following...
pobr -b -f tempname.tag -w -l -kf yourfile.c
... and see how many function definitions are printed on the screen.
/Pelle

Offline algernon77

  • Member
  • *
  • Posts: 7
Re: Version 10.00 (RC3) is now available
« Reply #20 on: July 21, 2020, 04:22:42 PM »
The other would be with the functions database of a particular project. It has about 70 functions declared and defined in a single file, but the browser on the right shows only about 15. On other projects with smaller nr. of functions per module (about 20), all seem to be ok. I tried deleting the tag file and rebuilding, but no luck. I'll attach a screenshot below. Am I doing something really outrageous?  :)
The screenshot only contain function prototypes, the project tree will only contain function definitions, but apart from that I can't say very much: not enough information.

The list of functions in the project tree comes from the browse info manager, which is not a full compiler, so there could be something in the syntax that the compiler can handle but not the browse info manager.

If you are comfortable with the command-line, you could try running the following...
pobr -b -f tempname.tag -w -l -kf yourfile.c
... and see how many function definitions are printed on the screen.

All the function definition are in the same file, under the prototypes, but it's about 176k of text, so they don't show in the screenshot.
HOWEVER  8) good news: after some sifting through the file with the pobr command line tool, I finally found the culprits: only 2 functions, see below:

Code: [Select]
static LRESULT CALLBACK OpenProc ( DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG FAR * pcb )
/*****************************************************************************************************************/
{
    switch ( g_file_enc )
    {
        case E_DONT_BOTHER:
        case E_ASCII:
            ReadFile ( ( HANDLE )dwCookie, pbBuff, cb, (LPDWORD)pcb, NULL );
            break;

        case E_WHATEVER:
            // check encoding
            break;

    }
   
    if ( g_hProgress )
    {
        SendMessage ( g_hProgress, PBM_SETRANGE, 0, MAKELPARAM ( 0, g_dwsize / cb ) );
        SendMessage ( g_hProgress, PBM_SETSTEP, ( WPARAM ) 1, 0 );
        SendMessage ( g_hProgress, PBM_STEPIT, 0, 0 );
    }

    return FALSE;
}

static LRESULT CALLBACK SaveProc ( DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG FAR * pcb )
/*****************************************************************************************************************/
{
    WriteFile ( ( HANDLE )dwCookie, pbBuff, cb, (LPDWORD)pcb, NULL );
    if ( g_hProgress )
    {
        SendMessage ( g_hProgress, PBM_SETRANGE, 0, MAKELPARAM ( 0, g_dwsize / cb ) );
        SendMessage ( g_hProgress, PBM_SETSTEP, ( WPARAM ) 1, 0 );
        SendMessage ( g_hProgress, PBM_STEPIT, 0, 0 );
    }
    return FALSE;
}

More precisely, it doesn't seem to like the "LONG FAR" combination, tried "const LONG * pcb" and "const FAR * pcb" and it works, but "LONG FAR" no :-)

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Version 10.00 (RC3) is now available
« Reply #21 on: July 21, 2020, 05:42:01 PM »
More precisely, it doesn't seem to like the "LONG FAR" combination, tried "const LONG * pcb" and "const FAR * pcb" and it works, but "LONG FAR" no :-)
OK, cool. I guess it's mainly "FAR", which has been dead as a dodo for many years...
I will try to fix this in the upcoming release version.

EDIT: When compiling, the FAR/NEAR/far/near macros will expand to nothing, so for consistency the Browse Information Manager will do the same (in the upcoming version).
« Last Edit: July 21, 2020, 06:17:12 PM by Pelle »
/Pelle

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Version 10.00 (RC3) is now available
« Reply #22 on: July 21, 2020, 06:20:36 PM »
algernon77,
Regarding "Just-in-time debugging", what is the output if you run the attached program/project?
/Pelle

Offline algernon77

  • Member
  • *
  • Posts: 7
Re: Version 10.00 (RC3) is now available
« Reply #23 on: July 21, 2020, 07:10:12 PM »
Hi, I compiled and executed it, it shows:

Code: [Select]
Postmortem debugger        : "d:\PellesC\bin\poide.exe" -p %ld -e %ld
Postmortem debugger (WOW64): "d:\PellesC\bin\poide.exe" -p %ld -e %ld

EDIT:
I just remembered something I've noticed this morning:
If I hover the mouse over a function name (say, CreateFile) it shows CreateFileW,
but the code completion feature (Ctrl+Shift+Space) shows CreateFileA with the corresponding params
(see attachments). Commented #define UNICODE and did a clean build, but still the same. Is it normal behaviour?
« Last Edit: July 21, 2020, 07:33:35 PM by algernon77 »

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Version 10.00 (RC3) is now available
« Reply #24 on: July 21, 2020, 07:24:41 PM »
Hi, I compiled and executed it, it shows:

Code: [Select]
Postmortem debugger        : "d:\PellesC\bin\poide.exe" -p %ld -e %ld
Postmortem debugger (WOW64): "d:\PellesC\bin\poide.exe" -p %ld -e %ld
Assuming "d:\PellesC" is the installation + execution path, looks OK so far (=enabled). If you uncheck the "JIT" option, press OK, and then run this program again: is the output exactly the same?


/Pelle

Offline algernon77

  • Member
  • *
  • Posts: 7
Re: Version 10.00 (RC3) is now available
« Reply #25 on: July 21, 2020, 07:37:46 PM »
I was just editing my previous post when you replied :)

The problem is that after I uncheck the option and click ok, if
I immediately open again the dialog box, the box is checked again  :-\

EDIT:
And yes, the output is the same
« Last Edit: July 21, 2020, 07:42:18 PM by algernon77 »

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Version 10.00 (RC3) is now available
« Reply #26 on: July 21, 2020, 07:58:02 PM »
I was just editing my previous post when you replied :)

The problem is that after I uncheck the option and click ok, if
I immediately open again the dialog box, the box is checked again  :-\

EDIT:
And yes, the output is the same
This is weird. I can't explain it. The logic behind this has stayed the same since *at least* 2010 (most recent change, cosmetic).
/Pelle

Offline algernon77

  • Member
  • *
  • Posts: 7
Re: Version 10.00 (RC3) is now available
« Reply #27 on: July 21, 2020, 08:44:44 PM »
Hmm.. I have a vm with W10 Pro x64, I've just installed RC3 inside and it does the same thing.. once you click it, you have it :)
I've deleted the registry keys and now it shows unchecked, but if I check it again, it's the same. This vm is quite clean,
does not have anything installed.

I've uninstalled RC3, deleted reg keys and installed v9, same behaviour.

If there's more I can do, just say, I still have a couple of days off 'till my vacation expires :)
« Last Edit: July 21, 2020, 11:11:51 PM by algernon77 »

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Version 10.00 (RC3) is now available
« Reply #28 on: July 22, 2020, 02:48:08 PM »
OK, finally... if the machine is clean enough, the 'JIT' removal can fail. It will be fixed in the release version (next couple of days).
/Pelle

Offline algernon77

  • Member
  • *
  • Posts: 7
Re: Version 10.00 (RC3) is now available
« Reply #29 on: July 22, 2020, 03:56:19 PM »
Thanks for all!