Skip to content

A struct and a function sharing a C name leads to unsolvable name collisions. #3

Description

@pette9

I was generating bindings for <sys/stat.h> on Linux which contains a struct stat and a C function stat(). The bindings generation fails and there seems to be no way to distinguish the struct tag stat and the function in the rename file. I've succeeded in generating the bindings through dropping stat by adding stat one liner on the rename file but this generates broken Go since the Stat struct is not defined. I have used this command: sobind -o stat.go -pkg main -style go -rename rename-stat /usr/include/sys/stat.h. I get this output:

Error: C names collide; copy these into a -rename file and edit the Solod names apart:
struct stat  Stat
stat         Stat

using other styles do not seem to solve the problem.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions