Skip to content

Commit 93f50ee

Browse files
committed
Suppress Coverity warnings
1 parent 01bb1b9 commit 93f50ee

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

platform/source/mbed_retarget.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ std::FILE *fdopen(FileHandle *fh, const char *mode)
443443
{
444444
// First reserve the integer file descriptor
445445
int fd = bind_to_fd(fh);
446-
if (!fd) {
446+
if (fd < 0) {
447447
return NULL;
448448
}
449449
// Then bind that to the C stream. If successful, C library
@@ -825,6 +825,7 @@ int _lseek(FILEHANDLE fh, int offset, int whence)
825825

826826
off_t off = lseek(fh, offset, whence);
827827
// Assuming INT_MAX = LONG_MAX, so we don't care about prototype difference
828+
// coverity[result_independent_of_operands]
828829
if (off > INT_MAX) {
829830
// Be cautious in case off_t is 64-bit
830831
errno = EOVERFLOW;

rtos/source/TARGET_CORTEX/rtx4/cmsis_os1.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ osMailQId osMailCreate (const osMailQDef_t *queue_def, osThreadId thread_id) {
267267
}
268268

269269
ptr->mp_id = osMemoryPoolNew (queue_def->queue_sz, queue_def->item_sz, &queue_def->mp_attr);
270+
// coverity[suspicious_sizeof]
270271
ptr->mq_id = osMessageQueueNew(queue_def->queue_sz, sizeof(void *), &queue_def->mq_attr);
271272
if ((ptr->mp_id == NULL) || (ptr->mq_id == NULL)) {
272273
if (ptr->mp_id != NULL) {

0 commit comments

Comments
 (0)