Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1694748 - Fix covscan new warnings
Summary: Fix covscan new warnings
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rasdaemon
Version: 7.7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Aristeu Rozanski
QA Contact: Jiri Dluhos
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-01 14:53 UTC by Aristeu Rozanski
Modified: 2019-04-03 15:24 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)

Description Aristeu Rozanski 2019-04-01 14:53:44 UTC
Description of problem:
On the last covscan:

1. Defect type: CLANG_WARNING
1. rasdaemon-0.4.1/ras-record.c:567:3: warning: Value stored to 'rc' is never read
#                 rc = ras_mc_prepare_stmt(priv, &priv->stmt_arm_record,
#                 ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4. rasdaemon-0.4.1/ras-record.c:567:3: note: Value stored to 'rc' is never read
#                 rc = ras_mc_prepare_stmt(priv, &priv->stmt_arm_record,
#                 ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   565|   	rc = ras_mc_create_table(priv, &arm_event_tab);
#   566|   	if (rc == SQLITE_OK)
#   567|-> 		rc = ras_mc_prepare_stmt(priv, &priv->stmt_arm_record,
#   568|   					&arm_event_tab);
#   569|   #endif
Collapse
2. Defect type: CLANG_WARNING
1. rasdaemon-0.4.1/ras-record.c:560:3: warning: Value stored to 'rc' is never read
#                 rc = ras_mc_prepare_stmt(priv, &priv->stmt_non_standard_record,
#                 ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4. rasdaemon-0.4.1/ras-record.c:560:3: note: Value stored to 'rc' is never read
#                 rc = ras_mc_prepare_stmt(priv, &priv->stmt_non_standard_record,
#                 ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   558|   	rc = ras_mc_create_table(priv, &non_standard_event_tab);
#   559|   	if (rc == SQLITE_OK)
#   560|-> 		rc = ras_mc_prepare_stmt(priv, &priv->stmt_non_standard_record,
#   561|   					&non_standard_event_tab);
#   562|   #endif
Collapse
3. Defect type: CLANG_WARNING
1. rasdaemon-0.4.1/ras-record.c:553:3: warning: Value stored to 'rc' is never read
#                 rc = ras_mc_prepare_stmt(priv, &priv->stmt_mce_record,
#                 ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4. rasdaemon-0.4.1/ras-record.c:553:3: note: Value stored to 'rc' is never read
#                 rc = ras_mc_prepare_stmt(priv, &priv->stmt_mce_record,
#                 ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   551|   	rc = ras_mc_create_table(priv, &mce_record_tab);
#   552|   	if (rc == SQLITE_OK)
#   553|-> 		rc = ras_mc_prepare_stmt(priv, &priv->stmt_mce_record,
#   554|   					 &mce_record_tab);
#   555|   #endif
Collapse
4. Defect type: CLANG_WARNING
1. rasdaemon-0.4.1/ras-record.c:546:3: warning: Value stored to 'rc' is never read
#                 rc = ras_mc_prepare_stmt(priv, &priv->stmt_extlog_record,
#                 ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4. rasdaemon-0.4.1/ras-record.c:546:3: note: Value stored to 'rc' is never read
#                 rc = ras_mc_prepare_stmt(priv, &priv->stmt_extlog_record,
#                 ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   544|   	rc = ras_mc_create_table(priv, &extlog_event_tab);
#   545|   	if (rc == SQLITE_OK)
#   546|-> 		rc = ras_mc_prepare_stmt(priv, &priv->stmt_extlog_record,
#   547|   					 &extlog_event_tab);
#   548|   #endif
Collapse
5. Defect type: CLANG_WARNING
1. rasdaemon-0.4.1/ras-record.c:539:3: warning: Value stored to 'rc' is never read
#                 rc = ras_mc_prepare_stmt(priv, &priv->stmt_aer_event,
#                 ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4. rasdaemon-0.4.1/ras-record.c:539:3: note: Value stored to 'rc' is never read
#                 rc = ras_mc_prepare_stmt(priv, &priv->stmt_aer_event,
#                 ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   537|   	rc = ras_mc_create_table(priv, &aer_event_tab);
#   538|   	if (rc == SQLITE_OK)
#   539|-> 		rc = ras_mc_prepare_stmt(priv, &priv->stmt_aer_event,
#   540|   					 &aer_event_tab);
#   541|   #endif
Collapse
6. Defect type: CLANG_WARNING
1. rasdaemon-0.4.1/ras-record.c:533:3: warning: Value stored to 'rc' is never read
#                 rc = ras_mc_prepare_stmt(priv, &priv->stmt_mc_event,
#                 ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4. rasdaemon-0.4.1/ras-record.c:533:3: note: Value stored to 'rc' is never read
#                 rc = ras_mc_prepare_stmt(priv, &priv->stmt_mc_event,
#                 ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   531|   	rc = ras_mc_create_table(priv, &mc_event_tab);
#   532|   	if (rc == SQLITE_OK)
#   533|-> 		rc = ras_mc_prepare_stmt(priv, &priv->stmt_mc_event,
#   534|   					 &mc_event_tab);
#   535|   
Collapse
7. Defect type: CLANG_WARNING
1. rasdaemon-0.4.1/ras-record.c:475:2: warning: Value stored to 'p' is never read
#         p += snprintf(p, end - p, ")");
#         ^    ~~~~~~~~~~~~~~~~~~~~~~~~~
4. rasdaemon-0.4.1/ras-record.c:475:2: note: Value stored to 'p' is never read
#         p += snprintf(p, end - p, ")");
#         ^    ~~~~~~~~~~~~~~~~~~~~~~~~~
#   473|   			p += snprintf(p, end - p, ", ");
#   474|   	}
#   475|-> 	p += snprintf(p, end - p, ")");
#   476|   
#   477|   #ifdef DEBUG_SQL
Collapse
8. Defect type: CLANG_WARNING
1. rasdaemon-0.4.1/ras-record.c:432:2: warning: Value stored to 'p' is never read
#         p += snprintf(p, end - p, ") VALUES ( NULL, ");
#         ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4. rasdaemon-0.4.1/ras-record.c:432:2: note: Value stored to 'p' is never read
#         p += snprintf(p, end - p, ") VALUES ( NULL, ");
#         ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   430|   	}
#   431|   
#   432|-> 	p += snprintf(p, end - p, ") VALUES ( NULL, ");
#   433|   
#   434|   	for (i = 1; i < db_tab->num_fields; i++) {
Collapse
9. Defect type: CLANG_WARNING
1. rasdaemon-0.4.1/ras-extlog-handler.c:142:2: warning: Value stored to 'p' is never read
#         p += sprintf(p-1, ")");
#         ^    ~~~~~~~~~~~~~~~~~
4. rasdaemon-0.4.1/ras-extlog-handler.c:142:2: note: Value stored to 'p' is never read
#         p += sprintf(p-1, ")");
#         ^    ~~~~~~~~~~~~~~~~~
#   140|   	if (cpd->validation_bits & CPER_MEM_VALID_MODULE_HANDLE)
#   141|   		p += sprintf(p, "module_handle: %d ", cpd->mem_dev_handle);
#   142|-> 	p += sprintf(p-1, ")");
#   143|   
#   144|   	return buf;
Collapse
10. Defect type: CLANG_WARNING
1. rasdaemon-0.4.1/libtrace/parse-filter.c:1200:3: warning: Value stored to 'len' is never read
#                 len = strlen(filter_str);
#                 ^     ~~~~~~~~~~~~~~~~~~
4. rasdaemon-0.4.1/libtrace/parse-filter.c:1200:3: note: Value stored to 'len' is never read
#                 len = strlen(filter_str);
#                 ^     ~~~~~~~~~~~~~~~~~~
#  1198|   		len = filter_start - filter_str;
#  1199|   	else
#  1200|-> 		len = strlen(filter_str);
#  1201|   
#  1202|   
Collapse
11. Defect type: CLANG_WARNING
1. rasdaemon-0.4.1/libtrace/parse-filter.c:1198:3: warning: Value stored to 'len' is never read
#                 len = filter_start - filter_str;
#                 ^     ~~~~~~~~~~~~~~~~~~~~~~~~~
4. rasdaemon-0.4.1/libtrace/parse-filter.c:1198:3: note: Value stored to 'len' is never read
#                 len = filter_start - filter_str;
#                 ^     ~~~~~~~~~~~~~~~~~~~~~~~~~
#  1196|   	filter_start = strchr(filter_str, ':');
#  1197|   	if (filter_start)
#  1198|-> 		len = filter_start - filter_str;
#  1199|   	else
#  1200|   		len = strlen(filter_str);
Collapse
12. Defect type: CLANG_WARNING
1. rasdaemon-0.4.1/libtrace/event-parse.c:3467:5: warning: Value stored to 'str' is never read
#                                 str = arg->field.name;
#                                 ^     ~~~~~~~~~~~~~~~
4. rasdaemon-0.4.1/libtrace/event-parse.c:3467:5: note: Value stored to 'str' is never read
#                                 str = arg->field.name;
#                                 ^     ~~~~~~~~~~~~~~~
#  3465|   			field = pevent_find_any_field(event, arg->field.name);
#  3466|   			if (!field) {
#  3467|-> 				str = arg->field.name;
#  3468|   				goto out_warning_field;
#  3469|   			}
Collapse
13. Defect type: CLANG_WARNING
1. rasdaemon-0.4.1/libtrace/event-parse.c:902:3: warning: Value stored to 'last_ch' is never read
#                 last_ch = 0;
#                 ^         ~
4. rasdaemon-0.4.1/libtrace/event-parse.c:902:3: note: Value stored to 'last_ch' is never read
#                 last_ch = 0;
#                 ^         ~
#   900|   		i--;
#   901|   		quote_ch = ch;
#   902|-> 		last_ch = 0;
#   903|    concat:
#   904|   		do {


Note You need to log in before you can comment on or make changes to this bug.