Skip to content

[BUILD] enum CanonicalCode names too generic... conflict with old C defines #2384

@VivekSubr

Description

@VivekSubr

Steps to reproduce
We use opentelemetry together with oss-asn library: https://www.oss.com/

What is the expected behavior?
No Problems

What is the actual behavior?
CanonicalCode enums conflict with #defines in the oss C code,

/usr/include/opentelemetry/trace/canonical_code.h:108:3: error: expected identifier
  OUT_OF_RANGE = 11,
  ^
/usr/include/ossasn1/ossasn1.h:1696:36: note: expanded from macro 'OUT_OF_RANGE'
#define OUT_OF_RANGE               33 /* parameter value range error */

We've been patching CanocicalCode enums with OTEL_ prefix to get around this, ie, OTEL_OUT_OF_RANGE... but the point remains that the enum names are too generic, this can happen if someone does '#define OK 1' as well.

Proposal -> prefix OTEL_ to all the enums in CanonicalCode

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions