Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parse error for empty constants #90

Merged
merged 1 commit into from Apr 17, 2020
Merged

Fix parse error for empty constants #90

merged 1 commit into from Apr 17, 2020

Conversation

pwaller
Copy link
Contributor

@pwaller pwaller commented Apr 17, 2020

When an empty macro definition is encountered, such as:

#define FOO

c-for-go would generate a constant whose name was equal to the printed
representation of name, which is a []byte. So you would see
something like [1 2 3 4 5] (except ascii values) appearing in a
go source where an IDENT was expected.

Instead, drop it, since a const without a value isn't a very interesting const.

When an empty macro definition is encountered, such as:

```c
#define FOO
```

c-for-go would generate a constant whose name was equal to the printed
representation of `name`, which is a `[]byte`. So you would see
something like `[1 2 3 4 5]` (except ascii values) appearing in a
`go` source where an IDENT was expected.

Instead, drop it, since a const without a value isn't a very interesting const.
@xlab xlab merged commit ce3604e into xlab:master Apr 17, 2020
@xlab
Copy link
Owner

xlab commented Apr 17, 2020

Thanks!

@pwaller pwaller deleted the patch-1 branch April 17, 2020 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants