Git Product home page Git Product logo

Comments (2)

eboasson avatar eboasson commented on June 5, 2024

Hi @vivekpandey02, a tiny patch to https://github.com/ADLINK-IST/idlpp-cxx solves the problem, at least in this particular case:

diff --git a/idlpp/ppresources/ospli/src/tools/idlpp/code/idl_genLiteISOCxxCopyin.c b/idlpp/ppresources/ospli/src/tools/idlpp/code/idl_genLiteISOCxxCopyin.c
index 0e0cb57..f7ef804 100644
--- a/idlpp/ppresources/ospli/src/tools/idlpp/code/idl_genLiteISOCxxCopyin.c
+++ b/idlpp/ppresources/ospli/src/tools/idlpp/code/idl_genLiteISOCxxCopyin.c
@@ -1615,7 +1615,7 @@ idl_unionCaseSequence(
              idl_seqAllocBuffer(idl_typeSeq(typeSpec), "length0", buf, sizeof(buf)));
         idl_seqLoopCopy (seqTypeSpec, "*src", "dest0", 1, 2, userData);
         idl_fileOutPrintf (idl_fileCur(), "        to->_u.%s._length = length0;\n", memberName);
-        idl_fileOutPrintf (idl_fileCur(), "        to->_u.%s._buffer = (uint8_t *)dest0;\n", memberName);
+        idl_fileOutPrintf (idl_fileCur(), "        to->_u.%s._buffer = dest0;\n", memberName);
     }
     idl_fileOutPrintf (idl_fileCur(), "    }\n");
 

A problem here is that I never bothered to get to know that code very well as it was always meant to be an interim hack until the new IDL compiler that natively supports C++ comes online (which should be really soon, it is starting to function). The thing that bothers me is that on the one hand it tries hard to make sure dest0 has the correct type, while on the other hand it explicitly casts it to something else. Surely there must have been a reason for that cast ... so I am worried this breaks something else.

Perhaps @e-hndrks could see if this change is actually the correct fix. In the mean time, perhaps you could give it a try?

from cyclonedds-cxx.

vivekpandey02 avatar vivekpandey02 commented on June 5, 2024

Dear Erik,

Thank you for your solution.

I have tested my example code with your solution. It is compiling now without any error.

With best regards,
Vivek

from cyclonedds-cxx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.