Author Topic: C++ debugging autos: "A syntax error in expression"  (Read 143 times)

at5dapa1

  • Senior Community Member
  • Posts: 173
  • Hero Points: 17
C++ debugging autos: "A syntax error in expression"
« on: October 09, 2019, 08:26:25 am »
debugging a C++ example (attached).
Code: [Select]
#include <stdio.h>
#define TYPES (3)
int main (int argc, char *argv[])
{
    const char typesIds[TYPES] = { '1', '2', '3' };
    unsigned counters[TYPES] = { 0 };
    for (unsigned i = 0; i < TYPES; i++) {
        counters[i]++;
        printf("%c => %d", typesIds[i], counters[i]);
    }
    return(0);
}

In the autos window the "typesIds", "TYPES"and "counters" are shown as:
Code: [Select]
     typesIds[const char=1] **A syntax error in expression, near `const char=1]'.**
     TYPES                  **No symbol "TYPES" in current context.**
     counters[unsigned=1]   **A syntax error in expression, near `unsigned=1]'.**
Still I can see their correct values in tooltips or Locals window...


Code: [Select]
SlickEdit Pro 2019 (v24.0.0.8 64-bit)
Serial number: WB951378
Licensed number of users: Single user
License file: C:\ProgramData\slickedit\24\slickedit.lic
Build Date: October 2, 2019
Emulation: Visual Studio
OS: Windows 10 x64
OS Version: 10.00.0 
Memory: 30% Load, 9839MB/32481MB Physical, 10902MB/32481MB Page File, 5339MB/134217727MB Virtual
Shell Information: C:\WINDOWS\system32\cmd.exe /q
Screen Size: 1920 x 1080, 1080 x 1920, 1920 x 1080
Project Type: Gnuc
Language: .cpp (C/C++)
Encoding: Automatic
Installation Directory: D:\tools\totalcmd\Tools\dev\SlickEdit\core\24.0.0\ (non-removable drive,NTFS,709474MB free)
Configuration Directory: D:\tools\totalcmd\Tools\dev\SlickEdit\config\24.0.0\ (non-removable drive,NTFS,709474MB free)
Spill File: C:\Users\xxx\AppData\Local\Temp\$slk.7788 (non-removable drive,NTFS,46809MB free)

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2791
  • Hero Points: 422
Re: C++ debugging autos: "A syntax error in expression"
« Reply #1 on: October 09, 2019, 02:12:26 pm »
I will look into this today.  This looks like a side-effect of another change.  I assume that you were on the first line of the function when it came up with those autos.

at5dapa1

  • Senior Community Member
  • Posts: 173
  • Hero Points: 17
Re: C++ debugging autos: "A syntax error in expression"
« Reply #2 on: October 09, 2019, 03:39:01 pm »
I assume that you were on the first line of the function when it came up with those autos.
Yes, those autos appear from the 1st line and they stay the same in the 2nd, 3rd, etc. Thanks for looking into this!

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2791
  • Hero Points: 422
Re: C++ debugging autos: "A syntax error in expression"
« Reply #3 on: October 11, 2019, 12:31:34 am »
This will be fixed in the first hot fix (the array variable declaration case).

"TYPES", being a #define, and not normally getting any meta-data from the compiler should be expected to fail to evaluate.