Sign in

username:

password:



Not a member?

Search code-comp



Search tips

Subscribe to code-comp



code-comp by Keywords

ARM7 | BIOS | Bug | EVM | JTAG | Linker | LOG_printf | McBSP | Profiling | Relocation | RTDX | Simulator | Target | Watch

Discussion Groups

Discussion Groups | Code-Composer | struct initialization

Technical discussions about Code Composer Studio.

  

Post a new Thread

struct initialization - tneu...@baumergroup.com - Sep 5 7:30:07 2007



Hi everybody,

I am using Code Composer Studio 3.3 with a DM6437 EVM. My work is to get some C-Code ported to
this TI Processor and I have a problem with the initialization of structs like in the following
example:

==================
typedef struct {
  int x;
  int y;
} Point;
int nX, nY;
...
Point Pt = {4*nX+1, 4*nY+1};
==================

CCS prints out the following error message:
error: expression must have a constant value

Other compilers like gcc can handle this dynamic initialization. Is there any compiler option
or workaround where I do not need to initialize every struct element by hand?

Thanks for your halp!

Tobias Neubert



(You need to be a member of code-comp -- send a blank email to code-comp-subscribe@yahoogroups.com )