Skip to content

Compilation warning on sign-conversion in the comms library #6

@TimonTerBraak

Description

@TimonTerBraak

During compilation with the sign-conversion warning flag enables yields the following warning:

include/comms/field/basic/ArrayList.h:676:49: warning: conversion to ‘__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char> >::difference_type’ {aka ‘long int’} from ‘long unsigned int’ may change the sign of the result [-Wsign-conversion]
  676 |         comms::util::assign(value(), iter, iter + std::min(len, comms::util::maxSizeOf(value())));

I found this while trying to harden my code base (MISRA 2023). I know it is a detail and likely low priority, but I just wanted to file this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions