hzzc1987 / jnaerator

Automatically exported from code.google.com/p/jnaerator
0 stars 0 forks source link

Unnamed (not anonymous) unions and structs not supported yet #60

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
(issue was reported on StackOverflow.com : 
http://stackoverflow.com/questions/2503183/jnaerator-unnamed-union-missing-
in-structure)

What steps will reproduce the problem?

Generate the following code :

typedef struct S {
  union {
    int var1;
    double var2;
  };
} S;

What is the expected output? What do you see instead?

Expect union to be given a name, then S and that union to be properly 
generated.

Instead : gives an empty S struct.
Solved if naming the union :

typedef struct S {
  union U {
    int var1;
    double var2;
  };
} S;

Original issue reported on code.google.com by olivier.chafik@gmail.com on 14 Apr 2010 at 5:49

GoogleCodeExporter commented 8 years ago
As pointed out on the StackOverflow page, the issue is not about anonymous 
unions/structs but about unnamed 
ones.

Unnamed structs and unions are not standard C, but JNAerator should 
nevertheless support them as GCC does :

http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gcc/unnamed-fields.h
tml

Original comment by olivier.chafik@gmail.com on 16 Apr 2010 at 1:10

GoogleCodeExporter commented 8 years ago

Original comment by olivier.chafik@gmail.com on 16 Apr 2010 at 1:10

GoogleCodeExporter commented 8 years ago
Hi,
This issue moved to Github :
https://github.com/ochafik/nativelibs4java/issues/94

Thanks for not updating this page anymore and adding further comments on Github.
Cheers
--
zOlive

Original comment by olivier.chafik@gmail.com on 1 Sep 2011 at 7:20