Skip to content

baggage.h is missing #include <cctype> for MSVC2015 #808

@lidavidm

Description

@lidavidm

Describe your environment

Windows 10 x64
MSVC 19.00.24210 (VS2015)

Steps to reproduce

OpenTelemetry (latest main @ 12e56f9) was built with cmake -GNinja .. -DWITH_API_ONLY=ON -DCMAKE_INSTALL_PREFIX=../install -DBUILD_TESTING=OFF.

Then I tried to build a trivial application including an OpenTelemetry header:

#include <opentelemetry/baggage/baggage.h>

int main(int, char**) {
    return 0;
}

What is the expected behavior?
The application should build successfully.

What is the actual behavior?

C:\Users\User\opentelemetry-cpp\install>cl.exe -Iinclude /EHsc /DHAVE_ABSEIL_VARIANT=1 test.cc
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24210 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

test.cc
include\opentelemetry/baggage/baggage.h(225): error C2039: 'isalnum': is not a member of 'std'
c:\users\user\opentelemetry-cpp\install\include\opentelemetry\nostd\./absl/types/variant.h(809): note: see declaration of 'std'
include\opentelemetry/baggage/baggage.h(248): error C2039: 'isdigit': is not a member of 'std'
c:\users\user\opentelemetry-cpp\install\include\opentelemetry\nostd\./absl/types/variant.h(809): note: see declaration of 'std'
include\opentelemetry/baggage/baggage.h(252): error C2039: 'isdigit': is not a member of 'std'
c:\users\user\opentelemetry-cpp\install\include\opentelemetry\nostd\./absl/types/variant.h(809): note: see declaration of 'std'
include\opentelemetry/baggage/baggage.h(252): error C2039: 'toupper': is not a member of 'std'
c:\users\user\opentelemetry-cpp\install\include\opentelemetry\nostd\./absl/types/variant.h(809): note: see declaration of 'std'
include\opentelemetry/baggage/baggage.h(273): error C2039: 'isalnum': is not a member of 'std'
c:\users\user\opentelemetry-cpp\install\include\opentelemetry\nostd\./absl/types/variant.h(809): note: see declaration of 'std'

Additional context

Adding #include <cctype> to baggage.h fixes the issue.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions