Is there an __attribute __ alternative ((packaged) C ++ 11/14 alternative)

C ++ 11 introduced the concept of a standardized attribute syntax. I could not find a list of all supported attributes. Is there an alternative to C ++ 11 for __attribute__((packed)) ?

eg.

 struct __attribute__((packed)) Pack { uint8_t field1; uint8_t field2; }; 
+7
c ++ gcc c ++ 11 clang c ++ 14
source share
1 answer

Unfortunately not. Attributes that currently define the standard:

  • [[noreturn]] ;
  • [[carries_dependency]] ;
  • [[deprecated]] / [[deprecated(reason)]] ;

Everything else is determined by implementation.

+11
source share

All Articles