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 of item 2 of issue 254 #274

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

brchiu
Copy link
Contributor

@brchiu brchiu commented Apr 19, 2018

Previous PR #273 can not be reopened, so I re-create a new one here after fix problem when dealing J2735's ASN file.

If the type of a field of information object set is imported from other module, then modify corresponding parameter to reflect the fact.

For the case stated in item 2 of #254, there are two RepeatRate defined in different modules, i.e.
TCICommonTypes.asn and IEEE-1609-3-WEE. So a suitable prefix using module name should be added to distinguish between them and two files, i.e. TCI-CommonTypes_RepeatRate.c and IEEE-1609-3-WEE_RepeatRate.c, are generated.

For module IEEE-1609-3-WSA, it import RepeatRate from module IEEE-1609-3-WEE. So

static const asn_ioc_cell_t asn_IOS_SrvAdvMsgHeaderTCI-CommonTypes_RepeatRate.h` and  `IEEE-1609-3-WEE_RepeatRate.c` are generated.ExtTypes_1_rows[] = {
	{ "&extRef", aioc__value, &asn_DEF_RefExt, &asn_VAL_1_c_RepeatRate },
	{ "&ExtValue", aioc__type, &asn_DEF_RepeatRate },
...
	{ "&ExtValue", aioc__type, &asn_DEF_AdvertiserIdentifier }
};

should be :

static const asn_ioc_cell_t asn_IOS_SrvAdvMsgHeaderTCI-CommonTypes_RepeatRate.h` and  `IEEE-1609-3-WEE_RepeatRate.c` are generated.ExtTypes_1_rows[] = {
	{ "&extRef", aioc__value, &asn_DEF_RefExt, &asn_VAL_1_c_RepeatRate },
	{ "&ExtValue", aioc__type, &asn_DEF_IEEE_1609_3_WEE_RepeatRate },
...
	{ "&ExtValue", aioc__type, &asn_DEF_AdvertiserIdentifier }
};

Starting from 3GPP release 11, there are also duplicate type names MobilityInformation defined in module S1AP-IEs and in module SonTransfer-IEs of 36.413 (S1AP) which suffer from this problem. There is error message when compiling with SonTransfer-IEs module along with other major S1AP modules.

ProtocolExtensionField.c:277:31: error: ‘asn_DEF_MobilityInformation’ undeclared here (not in a function); did you mean ‘S1AP_IEs_MobilityInformation_t’?
  { "&Extension", aioc__type, &asn_DEF_MobilityInformation },

Applying this pull request, the generated code become :

	{ "&Extension", aioc__type, &asn_DEF_S1AP_IEs_MobilityInformation },

thus solve S1AP's compilation problem.

1. Record the de-referenced expression to newly added field ref_expr
   of strcut asn1p_ref_t.
2. In function asn1c_make_identifier(), not only check whehter there
   is name clash occurred for this asn1p_expr_t but also the referenced
   expression to determine whether an additional module name to be added.
3. Change signature of some functions and variables to eliminate warning
   messages when const type pointer, i.e. const asn1p_ref_t *, variables
   versus, non-const * type pointer, i.e. asn1p_ref_t *, varibles are
   used. E.g.:
   warning: assignment discards ‘const’ qualifier from pointer target type
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 71.138% when pulling f97fac4 on brchiu:fix_of_item_2_of_issue_254 into 4cc779f on vlm:master.

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.

2 participants