idyntree icon indicating copy to clipboard operation
idyntree copied to clipboard

Investigate why SWIG does not like `[[deprecated]]` attributes

Open traversaro opened this issue 7 years ago • 9 comments

We now require C++14 to be used in the header, so in theory we could get rid of IDYNTREE_DEPRECATED_WITH_MSG and IDYNTREE_DEPRECATED in a favor of [[deprecated]] attributes. However SWIG seems to still have problem with it, we should check if it is a problem in old version of SWIG and eventually get rid of IDYNTREE_DEPRECATED_WITH_MSG and IDYNTREE_DEPRECATED .

traversaro avatar Jun 28 '18 14:06 traversaro

here they discuss about implementing the parsing of the attribute. I do not know if this means that SWIG is not able to ignore it if found.

francesco-romano avatar Jun 28 '18 15:06 francesco-romano

Apparently SWIG 3.* handles it correctly (i.e. it does not crash), while SWIG 2.0 has problems.

traversaro avatar Sep 10 '18 09:09 traversaro

Apparently SWIG 3.* handles it correctly (i.e. it does not crash), while SWIG 2.0 has problems.

I have version 3.0.10-1.1 and it fails while generating the interface.

necil avatar Dec 14 '18 07:12 necil

Hi @necil, what is the precise error that you are getting? It is related to [[deprecated]]?

traversaro avatar Dec 14 '18 08:12 traversaro

Hi @traversaro, thanks for support and quick reply. It fails when I add [[deprecated]] and error disappears when I remove it from code. Error consists of Error: Syntax error in input(3) and line in code. I have 2 questions: First one do you suggest a way to see more detailed log from this error? and and second one should I add a directive on my swig interface file to enable usage of deprecated?

necil avatar Dec 14 '18 12:12 necil

Just to clarify: you are discussing about a separate C++ project on which you run SWIG, not about iDynTree, right?

traversaro avatar Dec 14 '18 14:12 traversaro

I have 2 questions: First one do you suggest a way to see more detailed log from this error? and and second one should I add a directive on my swig interface file to enable usage of deprecated?

Can you build a Minimal Working Example reproducing this problem?

traversaro avatar Dec 14 '18 14:12 traversaro

http://www.swig.org/Doc4.0/SWIGDocumentation.html#CPlusPlus11_attributes

wangdf avatar May 07 '20 05:05 wangdf

@traversaro yeah it was a dummy code to just test that deprecate directive works. To be honest I do not remember why I have commented it under this repository it was a while ago. But probably it was a fault on my side.

necil avatar May 08 '20 01:05 necil