Commit 666c0250 authored by Christian Hilden's avatar Christian Hilden
Browse files

Merge branch '31-avoid-unused-variable-transitiondata-warning-in-generated-c-code' into 'master'

fix: Avoid unused variable warning for transitionData in generated c code (#31)

Closes #31

See merge request !6
parents 20cfa02c 23eeecab
Pipeline #3635 passed with stage
in 0 seconds
......@@ -387,7 +387,7 @@ class CExtensions implements ILanguageExtension {
else
GENERIC_DATA_NAME
val dataArg = ", "+dataName
val typedData = typeName+" "+dataName + " = "+deRef+"(("+castTypeName+") generic_data__et);\n"
val typedData = typeName+" "+dataName + " = "+deRef+"(("+castTypeName+") generic_data__et);\nET_TOUCH(" + dataName + ");\n"
val typedArgList = ", "+typeName+" "+dataName
return newArrayList(dataArg, typedData, typedArgList);
......
......@@ -102,7 +102,7 @@ class StateMachineGen extends GenericStateMachineGenerator {
override markVariableUsed(String varname) {
'''
((void)trigger__et); /* avoids unused warning */
((void)varname); /* avoids unused warning */
'''
}
override unreachableReturn() {
......
......@@ -16,6 +16,8 @@
#ifndef _ETSTDMACROS_H_
#define _ETSTDMACROS_H_
#define ET_TOUCH(x) ((void)(x))
#ifdef __cplusplus
#define ET_EXTERN_C_BEGIN extern "C" {
#define ET_EXTERN_C_END }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment