From 28e6bb5cf27efaf1160d6ea0dda6b4a09c8942ae Mon Sep 17 00:00:00 2001 From: Botond Baranyi <botond.baranyi@ericsson.com> Date: Mon, 3 Jun 2019 17:11:24 +0200 Subject: [PATCH] Legitimized compiler option '-F' (bug 547876) Change-Id: I3d44ca0eb15b64f3d754cce162ff2ac086dd4a52 Signed-off-by: Botond Baranyi <botond.baranyi@ericsson.com> --- compiler2/compiler.1 | 5 ++++- compiler2/main.cc | 3 ++- .../referenceguide/4-ttcn3_language_extensions.adoc | 1 + .../6-compiling_ttcn3_and_asn1_modules.adoc | 10 +++++++++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/compiler2/compiler.1 b/compiler2/compiler.1 index bc6392264..4a8b86cae 100644 --- a/compiler2/compiler.1 +++ b/compiler2/compiler.1 @@ -3,7 +3,7 @@ compiler \- TTCN-3 and ASN.1 to C++ translator .SH SYNOPSIS .B compiler -.RB "[\| " \-abcdDeEfgiIjlLMnNpqrRsStuwxXyY0 " \|]" +.RB "[\| " \-abcdDeEfFgiIjlLMnNpqrRsStuwxXyY0 " \|]" .RB "[\| " \-V .IR " verb_level" " \|]" .RB "[\| " \-J @@ -104,6 +104,9 @@ Forces the compiler to .I overwrite the output files even if they exist or are unchanged. .TP +.B \-F +Forces the compiler to generate the full C++ classes for records of/sets of basic types (i.e. boolean, integer, float, bitstring, hexstring, octetstring, charstring and unversal charstring). Otherwise only type aliases to pre-generated classes are generated for these types. This also disables the type compatibility between records of/sets of basic types in the Load Test Runtime. +.TP .B \-g The compiler error/warning messages will contain only the starting line number and column, in a format compatible with th GNU compiler (gcc). diff --git a/compiler2/main.cc b/compiler2/main.cc index 9ff9f62d2..e98ab2892 100644 --- a/compiler2/main.cc +++ b/compiler2/main.cc @@ -395,7 +395,7 @@ static boolean is_valid_asn1_filename(const char* file_name) static void usage() { fprintf(stderr, "\n" - "usage: %s [-abcdDeEfgiIjlLMnNOpqrRsStuwxXyY0] [-J file] [-K file] [-z file] [-V verb_level]\n" + "usage: %s [-abcdDeEfFgiIjlLMnNOpqrRsStuwxXyY0] [-J file] [-K file] [-z file] [-V verb_level]\n" " [-o dir] [-U none|type|'number'] [-P modulename.top_level_pdu_name] [-Q number] ...\n" " [-T] module.ttcn [-A] module.asn ...\n" " or %s -v\n" @@ -411,6 +411,7 @@ static void usage() " -e: enforce legacy handling of 'encode' and 'variant' attributes\n" " -E: display only warnings for unrecognized encoding variants\n" " -f: force overwriting of output files\n" + " -F: force generation of records of/sets of basic types and remove their compatibility\n" " -g: emulate GCC error/warning message format\n" " -i: use only line numbers in error/warning messages\n" " -I: enable real-time testing features\n" diff --git a/usrguide/referenceguide/4-ttcn3_language_extensions.adoc b/usrguide/referenceguide/4-ttcn3_language_extensions.adoc index 101e016f8..649bba736 100644 --- a/usrguide/referenceguide/4-ttcn3_language_extensions.adoc +++ b/usrguide/referenceguide/4-ttcn3_language_extensions.adoc @@ -8314,6 +8314,7 @@ while (f_fill_array(v_roi[sizeof(v_roi)], v_val)) { // and its sizeof would return 4 ---- +[[compatibility_of_record_of_types]] === Compatibility of record of types In the Function Test runtime `record of` and `set of` types of the same element type are compatible with each other. In the Load Test runtime this is only true for the following (TTCN-3) element types: diff --git a/usrguide/referenceguide/6-compiling_ttcn3_and_asn1_modules.adoc b/usrguide/referenceguide/6-compiling_ttcn3_and_asn1_modules.adoc index 74a5760bf..dbb2b1ba3 100644 --- a/usrguide/referenceguide/6-compiling_ttcn3_and_asn1_modules.adoc +++ b/usrguide/referenceguide/6-compiling_ttcn3_and_asn1_modules.adoc @@ -18,7 +18,7 @@ The program compiler resides in the directory `$TTCN3_DIR/bin`. The command line syntax of the compiler is the following: [source] -compiler [ -abBcdDeEfgiIjlLMnNOpqrRstuwxXyY0 ] [ -J file ] [ -K file ] [ -z file ] [ -N old|new ][ -o dir ] [ -V n ] [ -P toplevel pdu ] [ -Qn ] [ -U none|type|"number" ] …[ -T ] module.ttcn [ -A ] module.asn … [ - module.ttcn module.asn … ] +compiler [ -abBcdDeEfFgiIjlLMnNOpqrRstuwxXyY0 ] [ -J file ] [ -K file ] [ -z file ] [ -N old|new ][ -o dir ] [ -V n ] [ -P toplevel pdu ] [ -Qn ] [ -U none|type|"number" ] …[ -T ] module.ttcn [ -A ] module.asn … [ - module.ttcn module.asn … ] or @@ -104,6 +104,14 @@ Instructs the variant attribute parser to display warnings instead of errors for + Forces the compiler to overwrite (update) the output files even if they exist or the contents of them will be identical. Without this flag the output {cpp} header and source files will be overwritten only if their contents change compared to the previous version. +* `-F` ++ +Forces the compiler to generate the full {cpp} classes for `records of`/`sets of` basic types (i.e. `boolean`, `integer`, `float`, `bitstring`, `hexstring`, `octetstring`, `charstring` and `unversal charstring`). Otherwise only type aliases to pre-generated classes are generated for these types. This also disables the type compatibility between `records of`/`sets of` basic types in the Load Test Runtime (see <<4-ttcn3_language_extensions.adoc#compatibility_of_record_of_types>>). ++ +As of compiler version /5 R3A (5.3.pl0) the {cpp} classes for the mentioned `record of`/`set of` types are pre-generated, and are part of the runtime library. Before that they were generated into the {cpp} code the same as for other structured types. This command line option is mostly a legacy behavior switch, however the classes generated with this option are not identical to the classes generated with the old behavior (the new classes contain all codecs and the code needed to handle any possible coding instructions, not just the ones specified for the type). ++ +This option is used internally for pre-generating the mentioned {cpp} classes. + * `-g` + The compiler error/warning messages will contain the starting line number, and the starting column number if available. This option provides compatibility with the GNU compiler and many tools which are able to interpret its output (including Eclipse). -- GitLab