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


  • 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 huge tMyStruct;

void Test( void )

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


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

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3294
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: 7339
    • 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.
#ifdef XYZ
#define HUGE huge
#define HUGE

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 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
When in doubt, read the CB WiKi FAQ.