These are the diffs for defs_windows_386.h (and defs_windows_amd64.h) files generated with current cgo command and ...
10 years, 11 months ago
(2013-05-23 02:42:50 UTC)
#3
These are the diffs for defs_windows_386.h (and defs_windows_amd64.h) files
generated with current cgo command and proposed changed one:
# diff defs_windows_amd64.h ~/cl9574043/src/pkg/runtime/defs_windows_amd64.h
64,65d63
< struct FloatingSaveArea {
< };
# diff defs_windows_386.h ~/cl9574043/src/pkg/runtime/defs_windows_386.h
74,75d73
< struct M128a {
< };
#
It seems FloatingSaveArea and M128a are ARCH specific. They are not used
directly by our code, but they are embeded in other structs. They are present in
defs_windows.go, because cgo doesn't do recursion to discover embeded structs.
I suppose, FloatingSaveArea and M128a can be moved into ARCH specific file like
defs_windows_386.go and defs_windows_amd64.go, but I think it just complicates
things more.
I can just abandon this CL altogether. But I need more windows C structs for net
poller, and it bothers me that auto-generation does not work.
Alex
On 2013/05/23 04:41:32, brainman wrote: > On 2013/05/23 04:40:47, iant wrote: > > Are the ...
10 years, 11 months ago
(2013-05-23 04:50:42 UTC)
#6
On 2013/05/23 04:41:32, brainman wrote:
> On 2013/05/23 04:40:47, iant wrote:
> > Are the empty structs a problem?
>
> Yes. These fail to compile.
GCC permits empty structs, although I don't think they are in standard C. Are
they failing with a non-GCC compiler?
On a separate topic, the changes to the defs files are large and in general ...
10 years, 11 months ago
(2013-05-23 04:51:19 UTC)
#7
On a separate topic, the changes to the defs files are large and in general have
nothing to do with the change to cgo. Let's separate this CL from the CL that
regenerates those files.
On 2013/05/23 04:50:42, iant wrote: > > GCC permits empty structs, although I don't think ...
10 years, 11 months ago
(2013-05-23 04:55:20 UTC)
#8
On 2013/05/23 04:50:42, iant wrote:
>
> GCC permits empty structs, although I don't think they are in standard C. Are
> they failing with a non-GCC compiler?
Yes. They fail with 8c:
C:\go\root\src\pkg\runtime>go tool cgo -cdefs defs_windows.go >
defs_windows_386.h
C:\go\root\src\pkg\runtime>go install -v
runtime
# runtime
C:\DOCUME~1\brainman\LOCALS~1\Temp\go-build165623463\runtime\_obj\/defs_GOOS_GOARCH.h:75
c:\go\root\src\pkg\runtime\callback_windows_386.c:8 syntax error, lastname:
M128a
Alex
On 2013/05/23 04:51:19, iant wrote: > On a separate topic, the changes to the defs ...
10 years, 11 months ago
(2013-05-23 04:56:05 UTC)
#9
On 2013/05/23 04:51:19, iant wrote:
> On a separate topic, the changes to the defs files are large and in general
have
> nothing to do with the change to cgo. Let's separate this CL from the CL that
> regenerates those files.
Fair enough. I will remove them. But let's decide what to do first.
Alex
On 2013/05/23 04:56:05, brainman wrote: > On 2013/05/23 04:51:19, iant wrote: > > On a ...
10 years, 11 months ago
(2013-05-23 04:58:43 UTC)
#10
On 2013/05/23 04:56:05, brainman wrote:
> On 2013/05/23 04:51:19, iant wrote:
> > On a separate topic, the changes to the defs files are large and in general
> have
> > nothing to do with the change to cgo. Let's separate this CL from the CL
that
> > regenerates those files.
>
> Fair enough. I will remove them. But let's decide what to do first.
I'm fine with omitting empty structs from the generated C code. They are
unlikely to be useful.
On 2013/05/23 04:51:19, iant wrote: > ... Let's separate this CL from the CL that ...
10 years, 11 months ago
(2013-05-23 07:07:24 UTC)
#12
On 2013/05/23 04:51:19, iant wrote:
> ... Let's separate this CL from the CL that
> regenerates those files.
Done https://codereview.appspot.com/9679046/
Alex
Issue 9574043: code review 9574043: cgo: do not output empty struct
(Closed)
Created 10 years, 11 months ago by brainman
Modified 10 years, 11 months ago
Reviewers:
Base URL:
Comments: 0