From 446e13cd011232a88eefff811ce04f09accf1bc6 Mon Sep 17 00:00:00 2001 From: Botond Baranyi <botond.baranyi@ericsson.com> Date: Tue, 12 Mar 2019 16:59:32 +0100 Subject: [PATCH] Legitimized hidden compiler option '-0' (bug 545308) Change-Id: I2d5ba950928982896ac185e26bbcd1337bef8011 Signed-off-by: Botond Baranyi <botond.baranyi@ericsson.com> --- compiler2/compiler.1 | 10 +++++++++- compiler2/main.cc | 9 +++++++-- .../6-compiling_ttcn3_and_asn1_modules.adoc | 6 +++++- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/compiler2/compiler.1 b/compiler2/compiler.1 index dd9051efa..855da355e 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 "[\| " \-abcdDeEfgiIjlLMnNpqrRsStuwxXyY " \|]" +.RB "[\| " \-abcdDeEfgiIjlLMnNpqrRsStuwxXyY0 " \|]" .RB "[\| " \-V .IR " verb_level" " \|]" .RB "[\| " \-J @@ -349,6 +349,14 @@ Enables profiling and code coverage in the selected TTCN-3 files. The .I file argument contains a list of TTCN-3 files separated by new lines. Each TTCN-3 file must be among the compiler's TTCN-3 file arguments. .TP +.B \-0 +Disables attribute checks for +.I encvalue +and +.I decvalue. +Must be used together with option +.I \-s. +.TP .B \- The single dash character as command line argument controls the .I selective code generation diff --git a/compiler2/main.cc b/compiler2/main.cc index 4f81285f7..8ab07b04a 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 [-abcdDeEfgiIjlLMnNOpqrRsStuwxXyY] [-J file] [-K file] [-z file] [-V verb_level]\n" + "usage: %s [-abcdDeEfgiIjlLMnNOpqrRsStuwxXyY0] [-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" @@ -442,6 +442,7 @@ static void usage() " -y: disable subtype checking\n" " -Y: enforce legacy behaviour for \"out\" function parameters (see refguide)\n" " -z file: enable profiling and code coverage for the TTCN-3 files in the argument\n" + " -0: disable attribute checks for `encvalue' and `decvalue'\n" " -T file: force interpretation of file as TTCN-3 module\n" " -A file: force interpretation of file as ASN.1 module\n" " -v: show version\n" @@ -844,7 +845,7 @@ int main(int argc, char *argv[]) bflag || fflag || iflag || lflag || oflag || pflag || qflag || rflag || sflag || tflag || uflag || wflag || xflag || Xflag || Rflag || Uflag || yflag || Kflag || jflag || zflag || Fflag || Mflag || Eflag || - nflag || Bflag || Dflag || eflag || Oflag || Iflag) { + nflag || Bflag || Dflag || eflag || Oflag || Iflag || s0flag) { errflag = true; print_usage = true; } @@ -877,6 +878,10 @@ int main(int argc, char *argv[]) output_dir); errflag = true; } + if (s0flag && !sflag) { + ERROR("Option `-0' requires option `-s'"); + errflag = true; + } if (file_list_file_name != NULL) { FILE *fp = fopen(file_list_file_name, "r"); diff --git a/usrguide/referenceguide/6-compiling_ttcn3_and_asn1_modules.adoc b/usrguide/referenceguide/6-compiling_ttcn3_and_asn1_modules.adoc index cecbca391..74a5760bf 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 [ -abBcdDeEfgiIjlLMnNOpqrRstuwxXyY ] [ -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 [ -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 … ] or @@ -284,6 +284,10 @@ Enforces legacy behaviour for "out" function parameters ("out" parameters will n + Enables code coverage and profiling in the TTCN-3 files listed in the `file` argument. The TTCN-3 files in the list must be separated by new lines and must also appear among the compiler’s arguments. +* `-0` ++ +Disables attribute checks for `encvalue` and `decvalue`. Must be used together with option `-s`. + * `-` + The single dash character as command line argument has a special meaning: it controls the selective code generation. After the list of all TTCN–3 and ASN.1 modules a subset of these files can be given separated by a dash. This option instructs the compiler to parse all modules, perform the semantic analysis on the entire module hierarchy, but generate code only for those modules that are listed after the dash again. It is not allowed to specify a file name after the dash that was not present in the list before the dash. If the single dash is not present in the command line the compiler will generate code for all modules. -- GitLab