Skip to content
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

The C++ generator uses reserved symbols which introduces undefined bahaviour #42

Open
kheaactua opened this issue Oct 7, 2022 · 9 comments

Comments

@kheaactua
Copy link

The C++ templates here use the symbol _AttributeExtensions which is reserved.

template <typename ... _AttributeExtensions>
class «fInterface.proxyClassName»

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.

Reserved Names

I haven't encountered any problems with this, but it does introduce undefined behaviour which concerns me.

@goncaloalmeida
Copy link
Contributor

This problem is still occurring?

@kheaactua
Copy link
Author

Well the code hasn't been updated, so yes. :)

@goncaloalmeida
Copy link
Contributor

goncaloalmeida commented Nov 10, 2023

@kheaactua do you have any PR to fix this?
We can consider that for a future release.

cc @Gustavo1515 @lutzbichler

@kheaactua
Copy link
Author

Not yet, I'll create one.

@kheaactua
Copy link
Author

I created #65 but I haven't tested it.

I can't build org.genivi.commonapi.console (on master)

❯ mvn -Dtarget.id=org.genivi.commonapi.core.target clean verify

// ....

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.22.0:compile (default-compile) on project org.genivi.commonapi.console: Compilation failure: Compilation failure:                                                                                                                                    
[ERROR] /home/matt/workspace/capicxx-core-tools/org.genivi.commonapi.console/src/org/genivi/commonapi/console/ICommandLineHandler.java:[1]                                                                                                                                                                                    
[ERROR]         /* Copyright (C) 2015-2020 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 

@Gustavo1515
Copy link
Collaborator

I created #65 but I haven't tested it.

I can't build org.genivi.commonapi.console (on master)

❯ mvn -Dtarget.id=org.genivi.commonapi.core.target clean verify

// ....

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.22.0:compile (default-compile) on project org.genivi.commonapi.console: Compilation failure: Compilation failure:                                                                                                                                    
[ERROR] /home/matt/workspace/capicxx-core-tools/org.genivi.commonapi.console/src/org/genivi/commonapi/console/ICommandLineHandler.java:[1]                                                                                                                                                                                    
[ERROR]         /* Copyright (C) 2015-2020 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 

This error seems to be related with a wrong java version. Java 8 is the version that must be used.

@kheaactua
Copy link
Author

Oh, I'm pretty sure I was in the latest jdk, k, I'll set up java 8 and try

@kheaactua
Copy link
Author

I tried with https://hub.docker.com/r/eucm/maven , but got:

[WARNING] Error injecting: org.eclipse.xtend.maven.XtendCompile                                                                                                                                                                                                                                                               
com.google.inject.ProvisionException: Unable to provision, see the following errors:                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                              
1) [Guice/ErrorInjectingConstructor]: com.google.inject.internal.util.$ComputationException: com.google.inject.internal.util.$ComputationException: com.google.inject.internal.util.$ComputationException: com.google.inject.internal.util.$ComputationException: com.google.inject.internal.util.$ComputationException: Excep
tionInInitializerError                                                                                                                                                                                                                                                                                                        
  at XtendCompile.<init>(XtendCompile.java:29)                                                                                                                                                                                                                                                                                
  while locating XtendCompile                                                                                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                                                              
Learn more:                                                                                                                                                                                                                                                                                                                   
  https://github.com/google/guice/wiki/ERROR_INJECTING_CONSTRUCTOR                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                                                              
1 error                                                                                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                                                                                              
======================                                                                                                                                                                                                                                                                                                        
Full classname legend:                                                                                                                                                                                                                                                                                                        
======================                                                                                                                                                                                                                                                                                                        
XtendCompile:                "org.eclipse.xtend.maven.XtendCompile"                                                                                                                                                                                                                                                           
========================                                                                                                                                                                                                                                                                                                      
End of classname legend:                                                                                                                                                                                                                                                                                                      
========================

I don't think it's a downloading error. I'll give it another shot, and if it still fails I'll try a different container.

@kheaactua
Copy link
Author

Using eclipse/ubuntu_jdk8, I got:

[INFO] --- xtend-maven-plugin:2.20.0:compile (default) @ org.genivi.commonapi.core.target ---
[INFO] skip compiling sources because the configured directory '[/workspace/capicxx-core-tools/org.genivi.commonapi.core.target/src/main/java]' does not exist.
[INFO] 
[INFO] --- tycho-packaging-plugin:0.22.0:package-target-definition (default-package-target-definition) @ org.genivi.commonapi.core.target ---
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building org.genivi.commonapi.console 3.2.14-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ org.genivi.commonapi.console ---
[INFO] Deleting /workspace/capicxx-core-tools/org.genivi.commonapi.console/target
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] org.genivi.commonapi.core.releng ................... SUCCESS [ 23.246 s]
[INFO] org.genivi.commonapi.core.target ................... SUCCESS [  0.053 s]
[INFO] org.genivi.commonapi.console ....................... FAILURE [  1.061 s]
[INFO] org.genivi.commonapi.console.franca.feature ........ SKIPPED
[INFO] org.genivi.commonapi.console.feature ............... SKIPPED
[INFO] org.genivi.commonapi.core .......................... SKIPPED
[INFO] org.genivi.commonapi.core.cli ...................... SKIPPED
[INFO] org.genivi.commonapi.core.cli.feature .............. SKIPPED
[INFO] org.genivi.commonapi.core.cli.product .............. SKIPPED
[INFO] org.genivi.commonapi.core.ui ....................... SKIPPED
[INFO] org.genivi.commonapi.core.feature .................. SKIPPED
[INFO] org.genivi.commonapi.core.validator ................ SKIPPED
[INFO] org.genivi.commonapi.core.validator.feature ........ SKIPPED
[INFO] org.genivi.commonapi.core.updatesite ............... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 09:00 min
[INFO] Finished at: 2024-02-21T23:10:38+00:00
[INFO] Final Memory: 163M/1656M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project org.genivi.commonapi.console: Failed to clean project: Failed to delete /workspace/capicxx-core-tools/org.genivi.commonapi.console/target/classes -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :org.genivi.commonapi.console

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants