-
Notifications
You must be signed in to change notification settings - Fork 551
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
yet another missadventure with nodes in TNF_RSAFE/ types forward declaration mecanismes #332
Comments
Hi @ptizoom,
Why yet another, which was the previous one?
Which asn1c version do you use? For me it's working with the latest master 88ed3b5
Current master does not support See also #185 and https://github.com/nextepc/nextepc/tree/7a8e32f4538407384b073d26b7cb62f6f6506431/lib/s1ap/support |
should have just a formatting effect!
PS: can you show your [S5-Field] and [S1-A] headers? |
well after tracing a bit, I realize [S2-A] is not yet completely compiled when asn1s_compile_expr() [S1-A], then does not detect the link within [S5-Field] (which calls [S1-A]). |
@ptizoom, if the problem you mentioned is cyclic inclusion of header file, then adding There might be some sort of better solution, e.g. analyzing the dependency between each type, constant , .... , then constructing a DAG (directed acyclic graph) based on these dependency information and output an all-in-one header file which contains all generated C type with proper order. I have spent some time trying this approach but without success. Perhaps someone in the community could head to this direction. |
yes, this is a cyclic graph issue, but because the asn1c_expr_t are not complete and yet we print out the compiled section on the fly. it will not work for all cases. usually compilers uses 2 passes! and indeed I am using https://github.com/mouse07410/asn1c/ of "Chiu" and "mouse008". |
what I found so far, on this self inflected muddle, is that during phase_1_1, the "S4-Buck" expression is instancied more than once., so one is chained:
an the other...
this is confusing the recurrences check up at the end.. the later "S4-Buck"(AMT-TYPE) issued from "S3-C"(AMT_OBJECTCLASS) is far more furnished and link to "S5-Field" (and linking back to "S1-A"); this is what we expect, whereas the earlier "S4-Buck" expression is a dead end ! in fact, ..."a2".reference.ref_expr is cloned systematically from "S4-Buck" (at |
and after a long effort, I think now , that the compiling of asn1_compile() resolves the "Component Relation Constraint: " but too late: in this exemple ... recurrence with S1-A, S2-A is found when compiling S6-B, but S1-A has already been written out,
|
I left a patch on mouse07410#53 which does the trick at least on S1-A. |
in the bigger of schemes I am trying to compile this asn1c for LTE-S1AP-r14 messaging interface (I have attached the fellow FYI s1ap-14.5.0.asn1.zip
), and I think a similar issue operates there with this smaller example I prepared to illustrate a problem:
example :
731-modules-circular-OK.asn1.zip
with commands:
pushd /usr/src/ep_asn1c-build/tests/tests-asn1c-compiler
../../asn1c/asn1c -S /usr/src/asn1c/skeletons -Pfcompound-names /usr/src/asn1c/tests/tests-asn1c-compiler/731-modules-circular-OK.asn1 -pdu=all -fcompound-names -gen-PER
would give...:
there,
(and it is fine),
the structure is weird here as [S1-A] and [S2-A] are both forward declared and pre-included.
so...
horror! we see that we started by S2-A, then we return without defining the S2_A_t type, needed to close [S1-A] S1_A_t type.
the problem is complex.
we would compile fine if starting by including [S1-A] first.
but each header needs to be compiled first to work.
so to fix this, I thought ...
and/or
how best can this be done? can anyone suggest a general fix for this TNF_RSAFE ?
ta.
The text was updated successfully, but these errors were encountered: