Skip to content

Commit 4cd72b3

Browse files
committed
csparser: abstract out insignificant information
... from -Wanalyzer-use-of-uninitialized-value reports Reported-by: Justin Stephenson Closes: #34
1 parent 53cf1a9 commit 4cd72b3

File tree

8 files changed

+27
-0
lines changed

8 files changed

+27
-0
lines changed

src/csfilter.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ MsgFilter::MsgFilter():
110110
// unify (per build random) names of temporary variables
111111
d->addMsgFilter("COMPILER_WARNING", "_tmp[0-9]+_", "_tmp_");
112112

113+
// abstract out <Uf260> vs. <U4260> in:
114+
// "use of uninitialized value 'table_key.<Uf260>.str'"
115+
d->addMsgFilter("GCC_ANALYZER",
116+
"^(use of uninitialized value '[^'<]+\\.<)[^>]+(>.[^']+)'",
117+
"\\1XXX\\2");
118+
113119
// auxiliary info provided by valgrind directly in the key event message
114120
d->addMsgFilter("VALGRIND_WARNING",
115121
" lost in loss record [0-9,]+ of [0-9,]+$", "");

tests/csdiff/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,6 @@ test_csdiff(diff-misc 09-shellcheck-raw)
7777
test_csdiff(diff-misc 10-pylint-copr)
7878
test_csdiff(diff-misc 11-pylint-copr-json)
7979
test_csdiff(diff-misc 12-shellcheck-sc222x)
80+
test_csdiff(diff-misc 13-gcca-filt)
8081

8182
add_subdirectory(filter-file)

tests/csdiff/diff-misc/13-gcca-filt-add-z.err

Whitespace-only changes.

tests/csdiff/diff-misc/13-gcca-filt-add.err

Whitespace-only changes.

tests/csdiff/diff-misc/13-gcca-filt-fix-z.err

Whitespace-only changes.

tests/csdiff/diff-misc/13-gcca-filt-fix.err

Whitespace-only changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Error: GCC_ANALYZER_WARNING (CWE-457):
2+
sssd-2.6.3/src/lib/sifp/sss_sifp_parser.c: scope_hint: In function 'sss_sifp_parse_dict'
3+
sssd-2.6.3/src/lib/sifp/sss_sifp_parser.c:233:18: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'table_key.<U4260>.str'
4+
sssd-2.6.3/src/lib/sifp/sss_sifp_parser.c:461:5: note: in expansion of macro 'check_dbus_arg'
5+
sssd-2.6.3/src/lib/sifp/sss_sifp_parser.c:147:5: note: in expansion of macro 'check_dbus_arg'
6+
# 231|
7+
# 232| done:
8+
# 233|-> if (table_key.str != NULL) {
9+
# 234| _free(ctx, table_key.str);
10+
# 235| }
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Error: GCC_ANALYZER_WARNING (CWE-457):
2+
sssd-test_build_base_srpm_225/src/lib/sifp/sss_sifp_parser.c: scope_hint: In function 'sss_sifp_parse_dict'
3+
sssd-test_build_base_srpm_225/src/lib/sifp/sss_sifp_parser.c:233:18: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'table_key.<Uf260>.str'
4+
sssd-test_build_base_srpm_225/src/lib/sifp/sss_sifp_parser.c:461:5: note: in expansion of macro 'check_dbus_arg'
5+
sssd-test_build_base_srpm_225/src/lib/sifp/sss_sifp_parser.c:147:5: note: in expansion of macro 'check_dbus_arg'
6+
# 231|
7+
# 232| done:
8+
# 233|-> if (table_key.str != NULL) {
9+
# 234| _free(ctx, table_key.str);
10+
# 235| }

0 commit comments

Comments
 (0)