Compilation warnings with Clang
Summary
We built the latest Titan with Clang14.0.6 and used it to compile our TTCN code. Some of the generated C++ codes (even code included from Titan) caused Clang to complain. Sample of the generated warnings:
- S1AP_IEs.hh:78971:1: warning: declaration does not declare anything [-Wmissing-declarations] union { ^
- S1AP_IEs.cc:505086:37: warning: result of comparison of constant 128 with expression of type 'const S1AP__IEs::M3period::enum_type' is always true [-Wtautological-constant-out-of-range-compare]
- IP_Types.cc:5102:7: warning: variable 'value_of_length_field1' set but not used [-Wunused-but-set-variable]
- titan/8.3.0-rhel7-clang14.0.6-8103cc99-dirty/64_bit/include/Struct_of.hh:32:1: warning: class 'dynmatch_dummy_struct' was previously declared as a struct; this is valid, but may result in linker errors under the Microsoft C++ ABI [-Wmismatched-tags]
- titan/8.3.0-rhel7-clang14.0.6-8103cc99-dirty/64_bit/include/Port.hh:150:16: note: hidden overloaded virtual function 'PORT::log' declared here: different number of parameters (0 vs 1) virtual void log() const; ^
Steps and/or TTCN-3 code to reproduce
(How one can reproduce the issue - this is very important) (Please use code blocks (```) to format the code if provided.)
- Build Titan (from master) with Clang14.0.6
- Build the TTCN/ASN code with Titan
What is the current bug behavior?
Clang complains when compiling the generated C++ code.
What is the expected correct behavior?
No warnings when the generated C++ code is compiled with Clang.
Relevant logs and/or screenshots
The relevant files are attached.
Possible fixes
NA
Titan version
TTCN-3 and ASN.1 Compiler for the TTCN-3 Test Executor
Version: 8.3.0
Build date: Mar 22 2023 13:27:49
Compiled with: clang 14.0.6
Using OpenSSL 1.1.1g 21 Apr 2020
Commit id: 8103cc9-dirty
Platform details (OS type and version)
LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 7.9 (Maipo)
Release: 7.9
Codename: Maipo