Skip to content

Compiler warnings clean-up #249

Description

@maxgolov

Repo has 26 compiler warnings with vs2019 in:

  • tracez_processor_test
  • ostream_metrics_test
  • opentelemetry_exporter_ostream_metrics

Most of these are about potentially unsafe truncating type casts:

  • 'initializing': conversion from 'float' to 'int', possible loss of data
  • '=': conversion from 'double' to 'int', possible loss of data
  • '=': conversion from 'size_t' to 'int', possible loss of data
  • 'initializing': conversion from 'size_t' to 'int', possible loss of data
  • 'return': conversion from 'double' to 'T', possible loss of data

Recommendation is to fix those warnings. And change our build flags to All or Level 4 :

Compiler Compiler Flags
gcc -Wall -Wextra
clang -Wall -Wextra
MSVC /W4

Plus treat all warnings as errors by default across all compilers, to keep it at zero warnings at all times. It is gonna be progressively harder to clean it later if we don't keep it at zero from the very beginning.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions