-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed reserved _ from template name #65
base: master
Are you sure you want to change the base?
Conversation
These C++ templates used the symbol `_AttributeExtensions` which is reserved. Docs: > In addition to the names documented in this manual, reserved names include all external identifiers (global functions and variables) that begin with an underscore (‘_’) and all identifiers regardless of use that begin with either two underscores or **an underscore followed by a capital letter are reserved names**. This is so that the library and header files can define functions, variables, and macros for internal purposes without risk of conflict with names in user programs. See: Reserved Names (https://www.gnu.org/savannah-checkouts/gnu/libc/manual/html_node/Reserved-Names.html) This wasn't causing any visible issues, but best to fix it before it does.
@kheaactua very well, let's wait them until you find the problems. |
I don't think I'll have time to be able to get the generators to work. Last time I was successfully about to was in 2020, it took 2 days and a lot of support from people I don't have contact with anymore. |
I just managed to build this with the In case any one else hit annoying issues, these were my steps: # Pull a maven jdk8 image
❯ docker pull shinyay/docker-mvn-jdk8:3.6.3
# Run the image
❯ docker run -it shinyay/docker-mvn-jdk8 bash
# Download git
❯ yum install git
# Clones the tools
❯ git clone https://github.com/COVESA/capicxx-core-tools
# Changes directories
❯ cd capicxx-core-tools/org.genivi.commonapi.core.releng
# Ran maven
❯ mvn -Dtarget.id=org.genivi.commonapi.core.target clean verify
# Repeat maven command when it hits random failures |
The change appears to be successful and the generated code builds: For a sample (the diff is backwards) diff -r bld-neutrino-new_gen/RelWithDebInfo/main/fidl/capi-src-gen/core/proxy/v1/com/test/example/CapicxxExampleProxy.hpp bld-neutrino-old_gen/RelWithDebInfo/main/fidl/capi-src-gen/core/proxy/v1/com/test/example/CapicxxExampleProxy.hpp
3c3
< * Used org.genivi.commonapi.core 3.2.14.v202406101807.
---
> * Used org.genivi.commonapi.core 3.2.14.v202310241605.
35c35
< template <typename ... TAttributeExtensions>
---
> template <typename ... _AttributeExtensions>
39c39
< virtual public TAttributeExtensions... {
---
> virtual public _AttributeExtensions... {
226,228c226,228
< template <typename ... TAttributeExtensions>
< CapicxxExampleProxy<TAttributeExtensions...>::CapicxxExampleProxy(std::shared_ptr<CommonAPI::Proxy> delegate):
< TAttributeExtensions(*(std::dynamic_pointer_cast< CapicxxExampleProxyBase>(delegate)))...,
---
> template <typename ... _AttributeExtensions>
> CapicxxExampleProxy<_AttributeExtensions...>::CapicxxExampleProxy(std::shared_ptr<CommonAPI::Proxy> delegate):
> _AttributeExtensions(*(std::dynamic_pointer_cast< CapicxxExampleProxyBase>(delegate)))...,
232,233c232,233
< template <typename ... TAttributeExtensions>
< CapicxxExampleProxy<TAttributeExtensions...>::~CapicxxExampleProxy() {
---
> template <typename ... _AttributeExtensions>
> CapicxxExampleProxy<_AttributeExtensions...>::~CapicxxExampleProxy() {
236,237c236,237
< template <typename ... TAttributeExtensions>
< void CapicxxExampleProxy<TAttributeExtensions...>::getColor(CommonAPI::CallStatus &_internalCallStatus, ExampleTypes::Color &_color, const CommonAPI::CallInfo *_info) {
---
> template <typename ... _AttributeExtensions>
> void CapicxxExampleProxy<_AttributeExtensions...>::getColor(CommonAPI::CallStatus &_internalCallStatus, ExampleTypes::Color &_color, const CommonAPI::CallInfo *_info) { |
The C++ templates here use the symbol
_AttributeExtensions
which is reserved.capicxx-core-tools/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceProxyGenerator.xtend
Lines 162 to 163 in 1e6e696
Reserved Names
I haven't encountered any problems with this, but it does introduce undefined behaviour which concerns me.
This addressed #42. I haven't tested this PR as I have build issues with maven.