• Gustavo Niemeyer's avatar
    cgo: fix handling of signed enumerations · 45217825
    Gustavo Niemeyer authored
    Structs defined in C as containing a field with
    an enum type are currently translated to Go as
    a struct with an unsigned integer field, even if
    some of the values contained in the enum are
    negative.
    
    This modification takes in consideration the values
    defined in the enum, and conditionally defines the
    Go type as signed if necessary.
    
    The logic introduced was tested with gcc, which
    will increase the type size if it contains both
    negative numbers and values greater than 2^b/2-1,
    and refuses to compile values which would be
    problematic (2^64-1, but in fact the ISO C
    restricts the range to the size of int).
    
    R=rsc
    CC=golang-dev
    https://golang.org/cl/4119058
    45217825
Name
Last commit
Last update
..
5a Loading commit data...
5c Loading commit data...
5g Loading commit data...
5l Loading commit data...
6a Loading commit data...
6c Loading commit data...
6g Loading commit data...
6l Loading commit data...
8a Loading commit data...
8c Loading commit data...
8g Loading commit data...
8l Loading commit data...
cc Loading commit data...
cgo Loading commit data...
cov Loading commit data...
ebnflint Loading commit data...
gc Loading commit data...
godefs Loading commit data...
godoc Loading commit data...
gofmt Loading commit data...
goinstall Loading commit data...
gomake Loading commit data...
gopack Loading commit data...
gotest Loading commit data...
govet Loading commit data...
goyacc Loading commit data...
hgpatch Loading commit data...
ld Loading commit data...
nm Loading commit data...
prof Loading commit data...
clean.bash Loading commit data...
make.bash Loading commit data...