Code::Blocks

User forums => Embedded development => Topic started by: ChristophMS on April 23, 2018, 11:34:06 am

Title: Code Completion and near/far/huge variables
Post by: ChristophMS 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 :)
Title: Re: Code Completion and near/far/huge variables
Post by: BlueHazzard 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....
Title: Re: Code Completion and near/far/huge variables
Post by: stahta01 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: [Select]
#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.