Skip to content

A3-3-1: missing testcases #560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions change_notes/2024-03-19-change-alert-a3-3-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- `A3-3-1` - `ExternalLinkageNotDeclaredInHeaderFile.ql`:
- Adjust the alert message to comply with the style guide.
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ where
// Main functions are an exception to the rule
not de.getDeclaration() instanceof MainFunction and
if de.getDeclaration() instanceof Function then kind = "function" else kind = "object"
select de, "Externally linked " + kind + " " + de.getName() + " not declared in header file."
select de, "Externally linked " + kind + " '" + de.getName() + "' not declared in header file."
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
| test.cpp:3:5:3:6 | definition of g1 | Externally linked object g1 not declared in header file. |
| test.cpp:4:12:4:13 | declaration of g2 | Externally linked object g2 not declared in header file. |
| test.cpp:10:5:10:6 | definition of l1 | Externally linked object l1 not declared in header file. |
| test.cpp:11:6:11:7 | definition of f1 | Externally linked function f1 not declared in header file. |
| test.cpp:22:5:22:5 | definition of f | Externally linked function f not declared in header file. |
| test.cpp:25:5:25:6 | declaration of f1 | Externally linked function f1 not declared in header file. |
| test.cpp:3:5:3:6 | definition of g1 | Externally linked object 'g1' not declared in header file. |
| test.cpp:4:12:4:13 | declaration of g2 | Externally linked object 'g2' not declared in header file. |
| test.cpp:10:5:10:6 | definition of l1 | Externally linked object 'l1' not declared in header file. |
| test.cpp:11:6:11:7 | definition of f1 | Externally linked function 'f1' not declared in header file. |
| test.cpp:22:5:22:5 | definition of f | Externally linked function 'f' not declared in header file. |
| test.cpp:25:5:25:6 | declaration of f1 | Externally linked function 'f1' not declared in header file. |
6 changes: 5 additions & 1 deletion cpp/autosar/test/rules/A3-3-1/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@ namespace n {
void f5() { // COMPLIANT
int i = 0;
}
} // namespace n
} // namespace n

const int c = 1; // COMPLIANT - internal linkage
const char *const str2 = "foo"; // COMPLIANT - internal linkage
constexpr int k = 1; // COMPLIANT - internal linkage
Loading