Adding fields at the end of a C structure

The documentation includes general guidance on adding coding rules, including which languages support adding custom rules, and general guidance on how to go about it.
If the docs don’t answer your question, please tell us:

I have a requirement to flag C code if a change is made to a structure, meaning any addition, removal of new fields as well as changing the type of an existing field. What is allowed is only appending fields to an existing structure.
Is there a way to write a rule for it ?

  • What language are you writing rules for? C
  • What have you tried, and what’s your challenge / stumbling block

Please share the relevant code snippet, along with any error messages you’re encountering:


Welcome to the community!

Unfortunately, we don’t offer direct support for this. Your best bet is to detect these changes outside of / before your SonarQube analysis. You can then write that to a Generic Issue report and import the report into analysis.


Hi @rarakali

Just an addition.
Indeed, we do not support custom rules for C and C++ and we have no plan to do so at the moment.
Still, you can express your interest there.