Skip to content

Commit a765b9e

Browse files
MegabytePhreakj123b567
authored andcommitted
Resolve unused argument warning in SCPI_ErrorAddInternal
info_len may be unused if USE_DEVICE_DEPENDENT_ERROR_INFORMATION is 0
1 parent da2dd80 commit a765b9e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libscpi/src/error.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ int32_t SCPI_ErrorCount(scpi_t * context) {
130130

131131
static scpi_bool_t SCPI_ErrorAddInternal(scpi_t * context, int16_t err, char * info, size_t info_len) {
132132
scpi_error_t error_value;
133+
/* SCPIDEFINE_strndup is sometimes a dumy that does not reference it's arguments.
134+
Since info_len is not referenced elsewhere caoing to void prevents unusd argument warnings */
135+
(void) info_len;
133136
char * info_ptr = info ? SCPIDEFINE_strndup(&context->error_info_heap, info, info_len) : NULL;
134137
SCPI_ERROR_SETVAL(&error_value, err, info_ptr);
135138
if (!fifo_add(&context->error_queue, &error_value)) {

0 commit comments

Comments
 (0)