typedef Union in a header file for loadlibrary



Hello,

I want to include some c++ dlls into Matlab. One of the
header-files defines a union e.g.

typedef union
{
int a;
unsigned int b;
} union_AB;

which is used to call one of the dll-functions. When I
include this header I get the warning

Failed to parse type 'union { int a ; unsigned int b ; }
union_AB' original input 'union { int a ; unsigned int b ; }
union_AB'.

It's possile to use unions as variables and there is no
problem, if I try to typedef a struct or any other type.
What is the reason for this, and is it possible to avoid it?


Thanks,
Lars
.



Relevant Pages

  • Re: Portably extracting data from a bytestring
    ... >> into an unsigned int. ... >typedef union { ... that the behaviour is undefined to read a union member out of a ...
    (comp.lang.c)
  • Re: Unions Redux
    ... pointer casting. ... union U {double a; unsigned int b;} u; ... valid and aliasing rules don't work here. ...
    (comp.lang.c)
  • [PATCH] netfilter endian regressions
    ... struct xt_connlimit_info { ... unsigned int limit, inverse; ... union nf_conntrack_man_proto ... static inline bool already_closed ...
    (Linux-Kernel)
  • Re: Undefined behavior - 2 queries
    ... suitable-selected unsigned int to access all the bits within a float. ... optimization affect the access of float representation through a union ... Reading email is like searching for food in the garbage, ...
    (comp.lang.c)
  • [PATCH 13/19] dmaengine: add support for dma xor zero sum operations
    ... unsigned int src_off, size_t len, unsigned long flags); ... union dmaengine_addr dest, unsigned int dest_off, ... DMA channel to offload zero sum to ...
    (Linux-Kernel)