TOP

ASN.1/C++ Compiler -compat Flags Reference

Applies to: ASN.1/C++ 6.5

-compat allowBadDEFAULTValues

Starting with version 6.2, the ASN.1 Compiler reports an error message when a DEFAULT value exceeds the SIZE constraints on its DEFAULT field. Previously, the compiler silently truncated the size-constrained DEFAULT value that was too long, and issued a warning message. As a result, the DER/CER/C-OER encoder did not encode the value if it was equal to the truncated version of the DEFAULT value. The -compat allowBadDEFAULTValues compiler flag provides compatibility with previous versions.

↩-compat flags index


-compat externIntConst

Earlier versions of the ASN.1/C++ Compiler always generated extern const variables for all named values in the ASN.1 file, such as named numbers for INTEGER types and named bits for BIT STRING types. The generated header file contained only declarations of the variables; the variables were defined and initialized in the generated .cpp file. As of version 6.0.0, when the generated constant is an integer or enumerated type, such as

  • ASN.1 INTEGER type value references, unless the ASN1.HugeInteger or OSS.HUGE compiler directive is applied to the type
  • ASN.1 ENUMERATED type value references
  • named numbers in INTEGER types
  • named bits in BIT STRING types

the compiler generates the full definition in the header file. The generated constants can now be used as case labels in a switch statement. The –compat externIntConst compiler option restores the old behavior.

↩-compat flags index


-compat genericOpenTypes

Earlier versions of the ASN.1/C++ Compiler always used the OssOpen class to represent open types. Starting with version 6.0.0, the compiler uses a different representation for open types with table constraints applied: compiler-generated classes derived from the OssConstrainedOpenType runtime class. The -compat genericOpenTypes compiler option restores the old behavior. This compatibility option is equivalent to the –useGenericOpenTypes compiler option.

↩-compat flags index


-compat UTF8StringasBMPString

Earlier versions of the ASN.1/C++ Compiler used the OssBMPString class to represent the UTF8String ASN.1 type. As of version 4.0.0, the compiler uses the more suitable OssString class. The –compat UTF8StringasBMPString compiler option restores the old behavior.

↩-compat flags index


-compat v2.0
-compat v2.0.0

Provides compatibility with version 2.0.0 of the ASN.1/C++ Compiler.

The v2.0 (v2.0.0) flag is equivalent to specifying the following -compat options: externIntConst, genericOpenTypes, UTF8StringasBMPString, v4.3FalseExtendedConstraintEncoding, v4.3TableConstraintForExtensibleObjectSets, v4.3reservedWords, and v4.3NoEnumSharing.

↩-compat flags index


-compat v3.0
-compat v3.0.0

Provides compatibility with version 3.0.0 of the ASN.1/C++ Compiler.

The v3.0 (v3.0.0) flag is equivalent to specifying the –compat v2.0 option.

↩-compat flags index


-compat v3.1
-compat v3.1.0

Provides compatibility with version 3.1.0 of the ASN.1/C++ Compiler.

The v3.1 (v3.1.0) flag is equivalent to specifying the –compat v2.0 option.

↩-compat flags index


-compat v3.1.1

Provides compatibility with version 3.1.1 of the ASN.1/C++ Compiler.

The v3.1.1 flag is equivalent to specifying the –compat v2.0 option.

↩-compat flags index


-compat v3.1.2

Provides compatibility with version 3.1.2 of the ASN.1/C++ Compiler.

The v3.1.2 flag is equivalent to specifying the –compat v2.0 option.

↩-compat flags index


-compat v3.1.3

Provides compatibility with version 3.1.3 of the ASN.1/C++ Compiler.

The v3.1.3 flag is equivalent to specifying the –compat v2.0 option.

↩-compat flags index


-compat v4.0
-compat v4.0.0

Provides compatibility with version 4.0.0 of the ASN.1/C++ Compiler.

The v4.0 (v4.0.0) flag is equivalent to specifying the following -compat options: externIntConst, genericOpenTypes, v4.3FalseExtendedConstraintEncoding, v4.3TableConstraintForExtensibleObjectSets, v4.3reservedWords, and v4.3NoEnumSharing.

↩-compat flags index


-compat v4.0.1

Provides compatibility with version 4.0.1 of the ASN.1/C++ Compiler.

The v4.0.1 flag is equivalent to specifying the –compat v4.0 option.

↩-compat flags index


-compat v4.0.2

Provides compatibility with version 4.0.2 of the ASN.1/C++ Compiler.

The v4.0.2 flag is equivalent to specifying the –compat v4.0 option.

↩-compat flags index


-compat v4.1
-compat v4.1.0

Provides compatibility with version 4.1.0 of the ASN.1/C++ Compiler.

The v4.1 (v4.1.0) flag is equivalent to specifying the –compat v4.0 option.

↩-compat flags index


-compat v4.2
-compat v4.2.0

Provides compatibility with version 4.2.0 of the ASN.1/C++ Compiler.

The v4.2 (v4.2.0) flag is equivalent to specifying the –compat v4.0 option.

↩-compat flags index


-compat v4.2.1

Provides compatibility with version 4.2.1 of the ASN.1/C++ Compiler.

The v4.2.1 flag is equivalent to specifying the –compat v4.0 option.

↩-compat flags index


-compat v4.3
-compat v4.3.0

Provides compatibility with version 4.3.0 of the ASN.1/C++ Compiler.

The v4.3 (v4.3.0) flag is equivalent to specifying the –compat v4.0 option.

↩-compat flags index


-compat v4.3.1

Provides compatibility with version 4.3.1 of the ASN.1/C++ Compiler.

The v4.3.1 flag is equivalent to specifying the -compat externIntConst, -compat genericOpenTypes, -compat v4.3reservedWords, and -compat v4.3NoEnumSharing options.

↩-compat flags index


-compat v4.3.2

Provides compatibility with version 4.3.2 of the ASN.1/C++ Compiler.

The v4.3.2 flag is equivalent to specifying the -compat externIntConst, -compat genericOpenTypes, -compat v4.3reservedWords, and -compat v4.3NoEnumSharing options.

↩-compat flags index


-compat v4.3.3

Provides compatibility with version 4.3.3 of the ASN.1/C++ Compiler.

The v4.3.3 flag is equivalent to specifying the -compat externIntConst, -compat genericOpenTypes, -compat v4.3reservedWords, and -compat v4.3NoEnumSharing options.

↩-compat flags index


-compat v4.3FalseExtendedConstraintEncoding

Prior to version 4.3.1, the OSS PER runtime mishandled extensible SIZE constraints with no upper bound and extensible single value constraints on SEQUENCE OF, SET OF, OCTET STRING, and BIT STRING, for example,

SEQUENCE ({0}, ..., {1,2,3}) OF INTEGER

As a result, the PER encoder produced an invalid encoding that the PER decoder failed to decode or incorrectly decoded. As of version 4.3.1, the OSS ASN.1/C++ Compiler and the OSS PER runtime correctly handle such specifications.

The -compat v4.3FalseExtendedConstraintEncoding option disables the this behavior and provides compatibility with versions prior to 4.3.1.

↩-compat flags index


-compat v4.3TableConstraintForExtensibleObjectSets

Prior to version 4.3.1, the OSS Constraint Checker mishandled table and component relation constraint violations for extensible object sets. Starting with version 4.3.1, the OSS ASN.1/C++ Compiler and Runtime support ITU-T Rec. X.681 Annex E.2, in that a constraint violation error is reported when table or component relation constraints are not satisfied for an extensible object set and any of the following conditions is true:

  • The value of a UNIQUE field is found in the object set.
  • The STRICT_CONSTRAINT_CHECKING runtime flag is specified.
  • The OSS_AUTO_ENCODE_WITHOUT_CHECKING_CONSTRAINT encoder flag is not specified.

The -compat v4.3TableConstraintForExtensibleObjectSets option disables this behavior and provides compatibility with versions prior to 4.3.1.

↩-compat flags index


-compat v4.3reservedWords

Prior to version 5.0, the ASN.1/C++ Compiler generated the names "SID" and "small" without mangling, when present in the ASN.1 specification. This led to name conflicts with identifiers in system headers on MS Windows platforms. Starting with 5.0, the compiler mangles these names in generated code.

The -compat v4.3reservedWords option restores the previous behavior.

↩-compat flags index


-compat v4.3NoEnumSharing

Normally, the ASN.1/C++ Compiler searches the input specification for types that have identical C++ representations. When found, the compiler generates only one C++ class and several typedefs: one for each ASN.1 type. Prior to version 5.0, the compiler sometimes failed to recognize constructed types as identical when they contained ENUMERATED components. This bug was fixed in version 5.0.

The -compat v4.3NoEnumSharing option restores the old (pre-5.0) class-sharing behavior.

↩-compat flags index


-compat v5.0
-compat v5.0.0

Provides compatibility with version 5.0.0 of the ASN.1/C++ Compiler.

The v5.0 (v5.0.0) flag is equivalent to the –compat externIntConst and -compat genericOpenTypes options.

↩-compat flags index


-compat v5.0reservedWords

Prior to version 6.0, the ASN.1 Compiler generated the names "floor" and "send" without mangling, when present in the ASN.1 specification. This led to name conflicts with identifiers in system headers on MS Windows platforms. Starting with 6.0, the compiler mangles these names in generated code.

The -compat v5.0reservedWords option can be used to disable these changes, providing compatibility with versions earlier than 6.0.

Example

ASN.1

M DEFINITIONS ::= BEGIN
    TEN ::= ENUMERATED {send(1), floor(2)}
END
With -compat v5.0reservedWords Without -compat v5.0reservedWords
enum TEN {
    send = 1,
    floor = 2
};
enum TEN {
    TEN_send = 1,
    TEN_floor = 2
};

-compat v6.0
-compat v6.0.0

The v6.0 (v6.0.0) flag is the same as specifying no compatibility options. It exists for forward compatibility with future versions of the ASN.1/C++ Compiler.

↩-compat flags index


-compat v6.0Sharing

Normally, the ASN.1/C++ Compiler searches the input specification for types that have identical C++ representations. When found, the compiler generates only one C++ class and several typedefs: one for each ASN.1 type. Prior to version 6.0, the compiler sometimes failed to recognize constructed types as identical when they contained recursive definition loop components. This bug was fixed in version 6.1.

The -compat v6.0Sharing option restores the old (pre-6.0) class-sharing behavior.

↩-compat flags index


-compat v6.0valueTruncation

Prior to version 6.1, the ASN.1/C++ Compiler generated the value of a SEQUENCE OF or SET OF type with an extensible size constraint without truncation. Starting with 6.1, the compiler truncates such values to satisfy the size constraints applied to the type, unless the -allow BadValues command line option is in effect.

The -compat v6.0valueTruncation option can be used to disable these changes, providing compatibility with versions earlier than 6.1.

Example

ASN.1

M DEFINITIONS AUTOMATIC TAGS ::= BEGIN
    A ::= SEQUENCE (SIZE (1..2, ...)) OF INTEGER
    val A ::= {1, 2, 3}
END
Compiled with -compat v6.0valueTruncation Compiled without -compat v6.0valueTruncation
static struct A _v0[] = {
    {&_v0[1], 1},
    {&_v0[2], 2},
    {NULL, 3}
};
A val = _v0;
static struct A _v0[] = {
    {&_v0[1], 1},
    {NULL, 2}
};
A val = _v0;

↩-compat flags index


This documentation applies to release 6.5 and later of the OSS® ASN.1 Tools for C++.

Copyright © 2017 OSS Nokalva, Inc. All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means electronic, mechanical, photocopying, recording or otherwise, without the prior permission of OSS Nokalva, Inc.
Every distributed copy of the OSS® ASN.1 Tools for C++ is associated with a specific license and related unique license number. That license determines, among other things, what functions of the OSS ASN.1 Tools for C++ are available to you.