Questions tagged [qa-c]

For questions about configuration and usage of the static code analysis tool, QAC, as well as interpretation of messages and code metrics provided by the tool.

QAC (formerly QA-C) is a code quality assurance tool developed in 1986 for C language. Current versions additionally support C++, C# and Java. The tool provides a standalone GUI and command-line interface, and can also be integrated with Jenkins using PRQA Plugin.

QAC is distributed with pre-configured project settings for popular compilers (GCC and MS VC), as well as many compilers for embedded targets, notably Keil for ARM controllers. Generic settings are provided for unsupported compilers.

The code is checked against configurable sets of rules, notably MISRA rules (which restrict features of the C language which are deemed unsafe) and code quality metrics (like cyclomatic complexity).

References:

Related tags:

26 questions
0
votes
1 answer

Trying to pass too many includes to QA-C fail

I have a problem to add a source file to my QAC configuration. After many tries, I found out that the problem is with too many includes defined as an argument while calling QAC. If I will reduce the number of includes the QAC configuration will…
Lodhart
  • 205
  • 1
  • 6
  • 14
0
votes
1 answer

CI with QAC + Gitlab / Integration

I am trying to integrate QAC static analysis checks into Gitlab CI workflow (I could add Jenkins if needed) but I didn't find any guide/material. Is there anyone that tried to integrate Gitlab CI and PRQA/QAC? Thanks
EagleOne
  • 541
  • 1
  • 10
  • 28
0
votes
1 answer

PRQA QAC terminates after encountering #error directive

I am new to QAC stuff and I am trying to set up QAC on my project. I am currently encountering this error when I try to run QAC on a file. C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.2\arm\inc\c\intrinsics.h @@@ 26 @@@ 869 @@@ [Q]…
ank1099
  • 1
  • 1
0
votes
2 answers

Converting a pointer to X to an array of X

"Don't!" is the correct answer, but unfortunately it's not the one I need. If I do: size_t array_size = func_that_calc_array_size(); char *foo = new char[array_size]; if (array_size > 42) foo[42] = 'X'; This is all perfectly legal, but my MISRA…
Ken Y-N
  • 14,644
  • 21
  • 71
  • 114
0
votes
0 answers

std::map::find() warning from MISRA C++

We have the following code: class Foo { std::map m_throttle; // ... void bar(const uint8_t &msg_id) { if (m_throttle.find(msg_id) == m_throttle.end()) { // Whatever } …
Ken Y-N
  • 14,644
  • 21
  • 71
  • 114
0
votes
3 answers

Is it possible to suppress MISRA warning in QA-C

I used: #pragma QAC MESSAGE OFF. RULE NUMBER It works for many of the messages to suppress the QAC warnings but this technique is not working for Message No 434. Do we have any other methods to suppress these QAC warnings.
0
votes
1 answer

how to share array type definition without common header file?

Situation I'm using min GW compiler: >bin\cpp --version cpp.exe (GCC) 6.1.0 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or…
Timothy Truckle
  • 15,071
  • 2
  • 27
  • 51
0
votes
1 answer

Jenkin's Project is not triggering Automatically

I'm new to Jenkins, I created Python script for Auto-Trigger , If I run the python script by Manually All projects get triggered. For Automatic Trigger, I created a Project like "CVS_Jenkins", and In a Build section if i add below cmd it should…
Easi Test
  • 133
  • 1
  • 1
  • 10
0
votes
1 answer

Right hand operand of '&&' or '||' is an expression with possible side effects

Code statement look like below: if((temp1 == ID1) || (temp2 == (C_UINT16) ID2)) { } I am not sure why QAC is generating this warning. What will be the side effect & how to avoid this warning. Details for QAC-help: The right hand operand of a…
kapilddit
  • 1,729
  • 4
  • 26
  • 51
0
votes
1 answer

QA-C: license file

I'm trying to run QA-C 7.2 on a Nightly Build that I program using Python. It does run but the problem I encounter is, that I cannot save the license file configuration settings because IM not a 'license admin'. Hence, everytime I run QA-C it…
Martin Vegas
  • 127
  • 1
  • 13
-4
votes
1 answer

macro with structure definition missing '()' - QAC error

Here is the structure i wrote #define struct_macro(struct_type_name,struct_name) \ typedef struct struct_type_name \ { \ int a; \ char…
rakshi
  • 23
  • 6
1
2