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

Can't Compile External sequences #296

Closed
ddreyer opened this issue Sep 18, 2018 · 2 comments
Closed

Can't Compile External sequences #296

ddreyer opened this issue Sep 18, 2018 · 2 comments

Comments

@ddreyer
Copy link

ddreyer commented Sep 18, 2018

When I compile the following:

BEGIN

  MyObject ::= EXTERNAL

  SomeObject ::= SEQUENCE {
    body SEQUENCE OF MyObject
  }

END

The SEQUENCE member of SomeObject_t, body, compiles as A_SEQUENCE_OF(struct MyObject) list, where MyObject is forward declared but never declared anywhere else. It seems like it should compile to A_SEQUENCE_OF(struct MyObject_t) list. Is this supposed to occur?

@velichkov
Copy link
Contributor

Hi @ddreyer,

It seems like it should compile to A_SEQUENCE_OF(struct MyObject_t) list. Is this supposed to occur?

I agree that this could be improved but also it should work as is because this type is used only to define a pointer.

Also note that it is not directly related to the EXTERNAL and you could reproduce it with any other SEQUENCE (and probably with other types as well)

My-Schema DEFINITIONS ::=

BEGIN

MySequence ::= SEQUENCE {
	...
}

MyObject ::= MySequence -- EXTERNAL

SomeObject ::= SEQUENCE {
	body SEQUENCE OF MyObject
}

END

SomeObject.h

/* SomeObject */
typedef struct SomeObject {
	struct body {
		A_SEQUENCE_OF(struct MyObject) list;

MyObject.h

/* MyObject */
typedef MySequence_t	 MyObject_t;

The code that emits the type name in A_SEQUENCE_OF(...) is

OUT("%s", asn1c_type_name(arg, memb,
(memb->marker.flags & EM_UNRECURSE)
? TNF_RSAFE : TNF_CTYPE));

@ddreyer
Copy link
Author

ddreyer commented Sep 18, 2018

Understood, it just threw me off a bit because I was expecting a MyObject_t pointer rather than a MyObject pointer.

Also I forgot to mention that I am using this version: #295 (comment)

@ddreyer ddreyer closed this as completed Apr 10, 2019
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

No branches or pull requests

2 participants