commschamp / commsdsl

DSL schemas parser and code generators for CommsChampion Ecosystem
https://commschamp.github.io
Apache License 2.0
21 stars 9 forks source link

fix dangling references and add gcc13 compability #20

Closed mathisloge closed 1 year ago

mathisloge commented 1 year ago

enumDslObj() and dslObj() returns a new object, which goes out of scope after the assignment. Therefore there are dangling references after the assignments.

the cstdint is required for gcc13

arobenko commented 1 year ago

Hi Mathis, Sorry, you're wrong here, the places you're trying to fix are NOT dangling references. I must reject this pull request.

Details:

arobenko commented 1 year ago

Thanks for the report of missing <cstdint> though. I've added it in several other places on "develop" branch.

mathisloge commented 1 year ago

Hi Alex,

thanks for pointing that out. Due to the similar names of the classes I have not noticed the differences in the datatypes of mPimpl in the different Message types.

But then we still need to fix some false positive dangling reference compiler warnings. Currently it won't compile with gcc13. Should I wrap the calls here in


#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdangling-reference"
<code>
#pragma GCC diagnostic pop
arobenko commented 1 year ago

Unfortunately I don't have gcc-13 on my Linux environment and I'm a bit reluctant to configure docker with newer system versions to try and test it. I suggest adding an extra condition somewhere here:

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "13.0")
    list (APPEND extra_flags_list "-Wno-dangling-reference")
endif () 

Try it and let me know (or submit a pull request) if it works.