-
Notifications
You must be signed in to change notification settings - Fork 84
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
Cil.typsig conflates distinct function types #8
Comments
On Wed, Jan 22, 2014 at 04:30:33AM -0800, Stephen Kell wrote:
Off the top of my head and without checking the code, isn't it precisely I'll have a more detailed look at it next week. |
On Thu, 23 Jan 2014 13:32:15 -0800, Gabriel Kerneis wrote:
The point is that
and
are not equivalent in C. If you read the standard, you can find Next week (or later still) is fine... my workaround is working-around Stephen |
Next release will be 2.0 with other incompatible changes. I don't care to break everybody's code if it does the right thing — that's why major releases are for. I suspect few people pattern-match on typsig anyway, they are intended for comparison in the first place; also, this is a trivial fix for affected users to do. |
It's definitely not trivial to work around in client code. The client asks for a typsig and gets one back which is subtly inaccurate, perhaps arbitrarily far down in the nest. Fixing it in the client means implementing your own typsig. (Also, I pattern-match on typsig an awful lot.) My workaround happens far away, outside my CIL code, on detecting a failure which "shouldn't happen", and is an outrageous hack. I'll produce a patch in (hopefully) a few weeks' time. In the meantime it would be more appropriate to leave this issue open, although as you wish. |
There is a misunderstanding. I'll introduce an |
Ah, okay, cool. :-) |
This is an incompatible API change. It allows to distinguish the types of f() and f(void), which are treated differently in several places of the C standard. Closes #8, thanks to Stephen Kell.
CIL typsigs do not distinguish between the types
and
I will call the first case "no arguments specified" and the second "specified as no-arguments". They both yield the typesigs
Note that Cil.typ does encode this distinction, since the argument list can be Some([]) or None.
A possible fix which doesn't break absolutely everybody's code might be to take the C++ approach: the "no arguments specified" case is encoded as a zero-arguments varargs function, i.e.
whereas the "specified as no-arguments" case remains as-is.
I could be persuaded to work on a patch to fix this, although I am just working around it for now. :-)
The text was updated successfully, but these errors were encountered: