Package: asn1c Version: 0.9.14-1 Severity: normal L.S,
'asn1c' generates duplicate symbol definitions when processing ASN.1 source that is known to be correct. 'snacc' and some other ASN.1 compilers handle this without error. The attached file contais a structural extract that exhibits the problem. $ asn1c asn1c-problem-example.asn1 ....... Generated Makefile.am.sample $ make -f Makefile.am.sample cc -I. -o MSG.o -c MSG.c In file included from MSG.h:18, from MSG.c:9: MessageB.h:22: error: redeclaration of `enum msg_type' MessageB.h:23: error: conflicting types for `msg_type_inter_msg' EventA.h:24: error: previous declaration of `msg_type_inter_msg' MessageB.h:25: error: conflicting types for `msg_type_intra_msg' EventA.h:26: error: previous declaration of `msg_type_intra_msg' MessageB.h:25: error: redefinition of `msg_type_e' EventA.h:26: error: `msg_type_e' previously declared here make: *** [MSG.o] Error 1 $ -- System Information: Debian Release: 3.1 APT prefers testing APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.10-1-686-smp Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C) Versions of packages asn1c depends on: ii libc6 2.3.2.ds1-21 GNU C Library: Shared libraries an -- no debconf information
-- -- Demonstration of asn1c problem. -- ASN.1 code like this occurs in an ASN.1 description -- that is handled without errors by snacc -- Most ASN.1 code has been removed, only the parts leading to -- the error are left, with changed names. -- MESSAGES DEFINITIONS ::= BEGIN MSG ::= CHOICE { msg1 [0] IMPLICIT MessageA, -- first occurence msg2 [1] IMPLICIT MessageB -- second occurence } MessageA ::= SEQUENCE { id INTEGER, evt CHOICE { a [1] IMPLICIT EventA, b [2] IMPLICIT INTEGER } } EventA ::= SEQUENCE { time INTEGER, msg-type [2] IMPLICIT ENUMERATED { inter-msg (0), intra-msg (1) } OPTIONAL, info OCTET STRING (SIZE (1..2)) } MessageB ::= SEQUENCE { select BIT STRING { bit1 (0), bit2 (1), bit3 (2) }, msg-type [2] IMPLICIT ENUMERATED { inter-msg (0), intra-msg (1) } OPTIONAL } END -- EOF