Author Topic: Code Completion and near/far/huge variables  (Read 8177 times)

ChristophMS

  • Guest
Code Completion and near/far/huge variables
« on: April 23, 2018, 11:34:06 am »
Hi folks!

We're using Code::Blocks since for a couple of months now and I find it is a quite editor  :)

But sometimes the parser is annoying me. Now I found out what the problem is:
I'm coding for Infineon's 16 bit controllers which use different addressing schemes:
near, far and huge data. Variables and constants are marked with these attributes to determine the corresponding adressing scheme.
If I e.g. declare a structure to be "huge" the code completion won't show me any of the structure members. :-\
Without that attribute the members are shown without any problem.

Example code:

typedef struct
{
  short iVar1;
  short iVar2;
} TEST_TY;

TEST_TY huge tMyStruct;

void Test( void )
{
  tMyStruct.
}


In Test at tMyStruct. the effect takes place. Without "huge" it works ...
I've already tried to define huge as primary as well as secondary keyword but that has no effect on parsing.

Does anyone know how to fix that? I'm using C::B 16.1 ...


Thanks for your help  :) and kind regards

ChristophMS

B.t.w.: not using the attributes is no choice :)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Code Completion and near/far/huge variables
« Reply #1 on: April 23, 2018, 07:26:28 pm »
you can try to add a new keyword set and use it in cc. I don't know if this works...

Settings->Editor->Syntax higlighing->Keywords->Set: 4
Add your keywords

Settings->Editor->Code completion->Keywords sets to additionally include:
make a tick at 4

But! i am not sure if this works....

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Code Completion and near/far/huge variables
« Reply #2 on: April 23, 2018, 07:37:03 pm »
If BH Suggestion fails, I would add an header the defines HUGE as either hugh or nothing.
Code
#ifdef XYZ
#define HUGE huge
#else
#define HUGE
#endif

And, replace the XYZ with something your compiler defines.
Edit: Then use HUGH instead of hugh in your code.

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