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

camlidl: [unique] and [ptr] attributes are broken now! #3337

Closed
vicuna opened this issue May 5, 2002 · 2 comments
Closed

camlidl: [unique] and [ptr] attributes are broken now! #3337

vicuna opened this issue May 5, 2002 · 2 comments

Comments

@vicuna
Copy link

vicuna commented May 5, 2002

Original bug ID: 1142
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: -for CamlIDL use https://github.com/xavierleroy/camlidl/issues

Bug description

Full_Name: Dmitry Bely
Version: camlidl CVS version
OS: Windows 2000
Submission from: d065.p9.col.ru (212.248.7.65)

I have just updated camlidl from CVS and found out that [unique] attribute do
not work any longer. The declaration

typedef [unique,string] char* OptionalString;

now generates

type optionalString = string

instead of

type optionalString = string option

as it did before. [ptr] attribute does not work also. It also seems that you
decided to change the default string and bigarray attribute from [unique] to
[ref] (if I understand compiler/parse_aux.ml correctly). Why this was not
mentioned in the "Changes"? :-)

@vicuna
Copy link
Author

vicuna commented May 6, 2002

Comment author: administrator

I have just updated camlidl from CVS and found out that [unique] attribute do
not work any longer. The declaration

typedef [unique,string] char* OptionalString;

now generates

type optionalString = string

instead of

type optionalString = string option

as it did before. [ptr] attribute does not work also. It also seems that you
decided to change the default string and bigarray attribute from [unique] to
[ref] (if I understand compiler/parse_aux.ml correctly).

Correct. I got enough complaints about the old behavior
(i.e. pointer default attribute should not apply to strings or
arrays). However, due to a weakness of the current parsing of attributes,

    typedef [unique,string] char* OptionalString;

doesn't do what you want (a possibly NULL string), but

    typedef [string,unique] char* OptionalString;

does. I'll try to fix this soon.

Why this was not mentioned in the "Changes"? :-)

Quoting from Changes:

  • Strings, arrays and bigarrays are now non-NULL if "unique" is not specified,
    even if the pointer default is "unique".

Might have been phrased more clearly, perhaps.

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented May 7, 2002

Comment author: administrator

[string,unique] works as expected, [unique,string] does not, to be fixed.

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

No branches or pull requests

1 participant