NO

Author Topic: Release Candidate for version 11.00 is now available  (Read 33193 times)

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
/Pelle

Offline John Z

  • Member
  • *
  • Posts: 865
Re: Release Candidate for version 11.00 is now available
« Reply #1 on: July 23, 2021, 02:33:02 PM »
Wow amazing! Thank you Pelle.  Congratulations too.

John Z

Offline Marco

  • Member
  • *
  • Posts: 46
Re: Release Candidate for version 11.00 is now available
« Reply #2 on: July 23, 2021, 02:58:20 PM »
Great news! Thanks Pelle. I'm going to test it.

Grincheux

  • Guest
Re: Release Candidate for version 11.00 is now available
« Reply #3 on: July 23, 2021, 04:11:30 PM »
Thank You for this great jo Mr Pelle.

Offline Marco

  • Member
  • *
  • Posts: 46
Re: Release Candidate for version 11.00 is now available
« Reply #4 on: July 23, 2021, 04:39:57 PM »
Well, there are several more warnings during the compilation process, and some of them helped me to trace down a couple of tricky bugs. So, thanks Pelle again!

Regarding to the warnings, when I free an allocated buffer, and the same buffer is also freed elsewhere, the compiler shows the following:
Code: [Select]
void foo(void)
{
  char *buffer = malloc(32);
  if (buffer == NULL) return;
  buffer[0] = '\0';

  DWORD dwRet = GetLastError();           <-- Just an example. This is not important.
  if (dwRet)
  {
        free(buffer);
        return;
  }

  free(buffer);                           <-- warning #2116: Local 'buffer' is used without being initialized (or using a dangling value).
}

To 'fix' the warning, I have to modify the code as following:
Code: [Select]
void foo(void)
{

  char *buffer = malloc(32);
  if (buffer == NULL) return;
  buffer[0] = '\0';

  DWORD dwRet = GetLastError();
  if (dwRet)
  {
        free(buffer); buffer = NULL;      <-- 'fix'
        return;
  }

  free(buffer);                           <-- no more warning
}

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Release Candidate for version 11.00 is now available
« Reply #5 on: July 23, 2021, 05:09:21 PM »
Regarding to the warnings, when I free an allocated buffer, and the same buffer is also freed elsewhere, the compiler shows the following:
<snip>
Yes, I'm aware of this - that's why I called it "aggressive".
I have seen this for a few cases in my own code, and my solution was similar to yours.

It's somewhat tricky to separate the good warnings from the silly ones - maybe this can be improved over time... (I really like the good warnings, even if there is a little noise...)
/Pelle

Offline John Z

  • Member
  • *
  • Posts: 865
Re: Release Candidate for version 11.00 is now available
« Reply #6 on: July 23, 2021, 06:07:06 PM »
It ay be 'old style' but a simple change 'fixes' it.
Code: [Select]
void foo(void)
{char *buffer = NULL;

  buffer = malloc(32);
  if (buffer == NULL) return;
  buffer[0] = '\0';

  DWORD dwRet = GetLastError();
  if (dwRet)
  {
        free(buffer);                     //<-- no 'fix' needed
        return;
  }

  free(buffer);                           //<-- no more warning
}

John Z

Offline Marco

  • Member
  • *
  • Posts: 46
Re: Release Candidate for version 11.00 is now available
« Reply #7 on: July 23, 2021, 09:34:30 PM »
Yes, I'm aware of this - that's why I called it "aggressive".
I have seen this for a few cases in my own code, and my solution was similar to yours.

It's somewhat tricky to separate the good warnings from the silly ones - maybe this can be improved over time... (I really like the good warnings, even if there is a little noise...)

I agree with you. As I said, thanks to the 'noise' of this version, I found out a couple of tricky bugs in my projects.

It ay be 'old style' but a simple change 'fixes' it.
<snip>

Hi John. I tried your same solution prior to posting the 'fix', but that not 'solve' it. The warning is still there.

Offline John Z

  • Member
  • *
  • Posts: 865
Re: Release Candidate for version 11.00 is now available
« Reply #8 on: July 23, 2021, 10:28:14 PM »
Hi John. I tried your same solution prior to posting the 'fix', but that not 'solve' it. The warning is still there.

Really - that makes it a bit more interesting.  I did not post it without testing and seeing a good result.
I just now went back and tested again in two different programs and get no errors with Level 2 warnings enabled.
lt also compiled w/o error under C99, C11, and C17.

I always want to use the most robust checking, am I missing some higher level checking setting?

Thanks Marco,

John Z

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2122
Re: Release Candidate for version 11.00 is now available
« Reply #9 on: July 24, 2021, 07:21:55 AM »
Thanks Pelle for a new version to test.
May the source be with you

Offline MrBcx

  • Global Moderator
  • Member
  • *****
  • Posts: 195
    • Bcx Basic to C/C++ Translator
Re: Release Candidate for version 11.00 is now available
« Reply #10 on: July 24, 2021, 08:15:58 AM »
Thank you Pelle ... quite an impressive list of improvements over v10.

Also, the following did not go unnoticed, although I was hoping that it be named POBeautify   :D

"Added simple command-line driver for the IDE source code formatter DLL (cformat.dll), cleverly named cformat.exe."
Bcx Basic to C/C++ Translator
https://www.BcxBasicCoders.com

Offline algernon_77

  • Member
  • *
  • Posts: 33
Re: Release Candidate for version 11.00 is now available
« Reply #11 on: July 24, 2021, 08:23:29 AM »
Thanks for the new version!

It builds all my projects, minus one. It stops with "fatal error: Internal error: get_rule_number()". Projects builds fine under v10. OS is Win10 Pro 20H2, in a virtual machine.
I attach the zipped project.

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Release Candidate for version 11.00 is now available
« Reply #12 on: July 24, 2021, 08:42:43 AM »
Also, the following did not go unnoticed, although I was hoping that it be named POBeautify   :D
Nah, that's more than 8 characters... can't have that...  ;D
/Pelle

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Release Candidate for version 11.00 is now available
« Reply #13 on: July 24, 2021, 08:43:41 AM »
It builds all my projects, minus one. It stops with "fatal error: Internal error: get_rule_number()". Projects builds fine under v10. OS is Win10 Pro 20H2, in a virtual machine.
I will have a look..
/Pelle

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Release Candidate for version 11.00 is now available
« Reply #14 on: July 24, 2021, 11:04:31 AM »
It builds all my projects, minus one. It stops with "fatal error: Internal error: get_rule_number()". Projects builds fine under v10. OS is Win10 Pro 20H2, in a virtual machine.
I will have a look..
OK, had a look... special handling of infinite loop ( "while (TRUE)" ) inside a __try - __except block (leading to an unexpected abnormal CFG edge).

Can you please check that this new pocc.exe works for you too?
www.smorgasbordet.com/pellesc/1100/tmp/pocc_11_00_1.zip
/Pelle