Author Topic: Smartsense issue with bitwise struct pointing to a HW address  (Read 6080 times)

Offline scopaev

  • Single posting newcomer
  • *
  • Posts: 8
Smartsense issue with bitwise struct pointing to a HW address
« on: September 26, 2023, 05:02:07 pm »
Hi folks,
I was hoping someone could guide me in the direction of a solution.

When I assign hardware register addresses through a struct, CB is not sensing the new structure.  See example below.

Example:
  typedef struct FooStruct
  {
    uint8
      B0: 1,
      B1: 1,
      B2: 1,
      B3: 1,
      B4: 1,
      B5: 1,
      B6: 1,
      B7: 1;
  } foo_bits_t;
 
  foo_bits_t Var1;
  Var1.                                                                          // POPUP shows up with B0-B7  :D!                 

  foo_bits_t Var2 __attribute__((address(0x123)));
  Var2.                                                                          // NO POPUP  :(

 The extra stuff "__attribute__((address(0x123)))" seems to be causing issues with smartsense (I think that is what CB calls the awesome popup?).

Offline scopaev

  • Single posting newcomer
  • *
  • Posts: 8
Re: Smartsense issue with bitwise struct pointing to a HW address
« Reply #1 on: September 27, 2023, 03:59:47 pm »
I found another variance that is interesting.

foo_bits_t Var3[1] __attribute__((address(0x123)));
  Var3.                                                                              Works

So a plain variable confuses it, but an array is OK.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7670
    • My Best Post
Re: Smartsense issue with bitwise struct pointing to a HW address
« Reply #2 on: September 27, 2023, 11:52:50 pm »
Without the basic information you are not likely to get any help.

Code::Blocks version?

Which Code Completion (CC) are you using the old CC or the new clang CC?

What operating System (OS) are you using?

Note: I do not use CC; so, I cannot help anymore.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline scopaev

  • Single posting newcomer
  • *
  • Posts: 8
Re: Smartsense issue with bitwise struct pointing to a HW address
« Reply #3 on: September 28, 2023, 05:45:07 am »
Hi Tim, thanks for the reply.

CB 20.03
Code Completion 1.0 (Installed by default)
Windows 11

Does the CC have a way to add delimiters (looks like code completion is looking for "[ or ;"  after the variable name)?  In my case I would want to use a space " ".
How do I enable the new clang CC to see if it works?

Thanks for any guidance.