On Mon, Sep 19, 2016 at 8:50 AM, Ali Demir <dem...@gmail.com> wrote:
> Header file won't have padding / alignment info. That would be a compiler
> setting on the C side that is using the header. So the programmer needs to
> setup C compiler in a way that is compatible with the go compiler. How would
> he know how to set it up? Do we just assume defaults are the same between Go
> and C?

The cgo tool will generate padding fields as needed to ensure that the
fields are aligned as expected.

It's true that the cgo tool does assume that it knows the alignment
requirements of the basic types.  These requirements are not normally
changed by compiler options.  The alignment requirements of unusual
types, such as processor-specific vector types, are not relevant,
since Go can't represent them and they will therefore never appear in
the Go/C interface.

Do you have a specific concern, or is this purely abstract?


You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to