Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000938Taste[All Projects] ASN.1 Compiler v4public2020-11-11 18:112020-11-11 19:50
Reportergmamais 
Assigned Togmamais 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Summary0000938:

issues when a type is defined more than once

Description

I could reproduce it with this simple grammars:

D0 DEFINITIONS ::=
BEGIN
T2 ::= NULL
END

D1 DEFINITIONS ::=
BEGIN
T2 ::= BOOLEAN
END
D2 DEFINITIONS ::=
BEGIN
IMPORTS T2 FROM D1;

T1 ::= SEQUENCE {
bar D1.T2
}
END

If you run asn1.exe -c -uPER file.asn

and try to compile the resulting files, you get these errors:

$ gcc -c .c
clash.c: In function 'T1_IsConstraintValid':
clash.c:110:11: warning: implicit declaration of function 'T2_IsConstraintValid'; did you mean 'T1_IsConstraintValid'? [-Wimplicit-function-declaration]
110 | ret = T2_IsConstraintValid((&(pVal->bar)), pErrCode);
| ^~~~~~~~~~~~~~~~~~~~
| T1_IsConstraintValid
clash.c: In function 'T1_Encode':
clash.c:123:23: warning: passing argument 1 of 'T2_Encode' from incompatible pointer type [-Wincompatible-pointer-types]
123 | ret = T2_Encode((&(pVal->bar)), pBitStrm, pErrCode, FALSE);
| ~^~~~~~~~~~~~~
| |
| const D1_T2 * {aka const _Bool *}
clash.c:23:26: note: expected 'const T2 *' {aka 'const char *'} but argument is of type 'const D1_T2 *' {aka 'const _Bool *'}
23 | flag T2_Encode(const T2
pVal, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints)
| ~~~~~~~~~~^~~~
clash.c: In function 'T1_Decode':
clash.c:137:19: warning: passing argument 1 of 'T2_Decode' from incompatible pointer type [-Wincompatible-pointer-types]
137 | ret = T2_Decode((&(pVal->bar)), pBitStrm, pErrCode);
| ~^~~~~~~~~~~~~
| |
| D1_T2 * {aka _Bool *}
clash.c:37:20: note: expected 'T2 *' {aka 'char *'} but argument is of type 'D1_T2 *' {aka '_Bool *'}
37 | flag T2_Decode(T2* pVal, BitStream* pBitStrm, int* pErrCode)
| ~~~~^~~~

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0003749)
gmamais (developer)
2020-11-11 19:35

fixed

(0003750)
maxime (administrator)
2020-11-11 19:50

Thanks! closing


- Issue History
Date Modified Username Field Change
2020-11-11 18:11 gmamais New Issue
2020-11-11 18:11 gmamais Status

new => assigned

2020-11-11 18:11 gmamais Assigned To

=> gmamais

2020-11-11 19:35 gmamais Note Added: 0003749
2020-11-11 19:35 gmamais Status

assigned => resolved

2020-11-11 19:35 gmamais Resolution

open => fixed

2020-11-11 19:50 maxime Note Added: 0003750
2020-11-11 19:50 maxime Status

resolved => closed



Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker