Skip to content

c++ generated bundle class fails to compile in gcc when model contains leaf 'minor' #1024

@ericjmonson

Description

@ericjmonson

Issue tracker is ONLY used for reporting bugs. Please use the YDK Community for any support issues.

Expected Behavior

It is expected that the cisco_ios_xe bundle will successfully compile using gcc.

Current Behavior

Does not compile due to minor being interpreted as a macro in gcc that maps to 'gnu_dev_minor'. It appears that any leaf node with the name "major" is renamed "major_" in the code. It would seem that doing the same for minor would resolve the problem.

Steps to Reproduce

Download the latest repo. Generate the cisco_ios_xe bundle. Try to compile it:

Your Script

Logs

In file included from /usr/include/sys/types.h:222:0,
from /usr/include/stdlib.h:314,
from /usr/include/c++/4.8.2/cstdlib:72,
from /usr/include/c++/4.8.2/ext/string_conversions.h:41,
from /usr/include/c++/4.8.2/bits/basic_string.h:2815,
from /usr/include/c++/4.8.2/string:52,
from /usr/include/c++/4.8.2/bits/locale_classes.h:40,
from /usr/include/c++/4.8.2/bits/ios_base.h:41,
from /usr/include/c++/4.8.2/ios:42,
from /usr/include/c++/4.8.2/istream:38,
from /usr/include/c++/4.8.2/sstream:38,
from /tmp/ydk-gen-master/gen-api/cpp/cisco_ios_xe-bundle/ydk/models/cisco_ios_xe/fragmented/Cisco_IOS_XE_native_223.cpp:2:
/tmp/ydk-gen-master/gen-api/cpp/cisco_ios_xe-bundle/ydk/models/cisco_ios_xe/fragmented/Cisco_IOS_XE_native_223.cpp: In constructor 'cisco_ios_xe::Cisco_IOS_XE_native::Native::Event::Manager::Applet::Event_::Env::Severity::Severity()':
/tmp/ydk-gen-master/gen-api/cpp/cisco_ios_xe-bundle/ydk/models/cisco_ios_xe/fragmented/Cisco_IOS_XE_native_223.cpp:2814:7: error: class 'cisco_ios_xe::Cisco_IOS_XE_native::Native::Event::Manager::Applet::Event_::Env::Severity' does not have any field named 'gnu_dev_minor'
, minor(nullptr) // presence node

System Information

Centos 7 / gcc 4.8.5 / python 3.6.8 / x86_64

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions