This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

can't pack struct with long long member

Other Parts Discussed in Thread: MSP430FR5739

I am using CCS5 RC with a M4F processor.  I have several structs that I am packing using __attribute__ ((packed)) which works except for this struct:

typedef struct _bsd_select_args_t

{

    long nfds;

    long rdoffset;

    long wroffset;

    long exoffset;

    long tooffset;

    unsigned long isblock;

    unsigned long rdfd;

    unsigned long wrfd;

    unsigned long exfd;

    unsigned long long timeout;

}__attribute__ ((packed)) bsd_select_args_t;

I get the following error:

#1167 invalid attribute for "struct _bsd_select_args_t" ..... line 125 C/C++ Problem

 

if I change timeout member from:

unsigned long long timeout;

to:

unsigned long timeout;

then it build ok.

I therefore can only assume that the packed attribute is not working for long long type.

 

Note:

I also have built this file for the MSP430FR5739 without problem so I think it is only an issue with the ARM compiler.

 

  • Our current version of the ARM compiler only supports the GCC packed attribute on targets that have hardware support for unaligned loads and stores, and for the data sizes that are supported.  The ARM Cortex targets, including M4F, have hardware support for unaligned accesses for data sizes through 32 bits only.  We have added support for packed 64-bit data sizes on these targets (as well as packed attribute support for other ARM targets that don't have hardware support for unaligned accesses) in the next version of our compiler.

    Our next release will include:

    -- packed support for 64-bit data sizes on ARM Cortex targets

    -- packed support for data sizes through 64-bits on pre-Cortex ARM targets with --abi=eabi

    --packed support for data sizes through 32 bits on pre-Cortex ARM targets with COFF abi

  • good to know. Thank you.  

    When is this version planned to be released?

  • The next release will be ARM CGT 5.0 and it is planned for the middle of next year.