Issues in using string in 5.2.0

3 posts / 0 new
Last post
Offline
Last seen: 8 years 7 months ago
Joined: 05/14/2015
Posts: 6
Issues in using string in 5.2.0

1. Created following IDL file.

typedef string str;
typedef str str_el;
struct abc
{
str_el dhruv;
};

2. Input this file to rtiddsgen in connext 5.2.0 and run.

3. On compiling the generated make file, it throws compilation errors (logs attached

4. However , on changing the first line to "typedef char* str", it works fine. Also on using rtiddsgen of connext 5.1.0, no such problem observed.

5. Plz explain.

 

 

AttachmentSize
Plain text icon error_idl.txt4.05 KB
Organization:
Gerardo Pardo's picture
Offline
Last seen: 4 weeks 20 hours ago
Joined: 06/02/2010
Posts: 601

Hi,

There seems to be a bug in rtiddsgen generating code when a typedef references another typedef.

This is caused by the fact that actual type-plugin code (serialization, deserialization, printing)  is generated only for the actual types (i.e. string and struct abc) and not the alias types defined by a typedef.  When rtiddsgen sees a typedef it emits code for the resolved (unaliased) type.  However it seems than when encountering the  str_el dhruv member in struct abc, rtiddsgen realizes str_el is an alias but does not realize that the alased type for str_el, that is,  str is also an alias. Because of this it generates code assuming the actual is str which is incorrect resulting on the compile-time errors since that code does not exist.

The problem goes away if you define the typedef refering to the resolved actual  types  rather than to other aliases as in:

typedef string str;
typefef string str_el;

struct abc {
    str_el dhruv;
};      

I have filed a bug report (CODEGEN-789) to track the issue so that we can get it fixed in a future release.

Gerardo

Offline
Last seen: 8 years 7 months ago
Joined: 05/14/2015
Posts: 6

Thanks a lot Mr Gerardo,

I would be obliged if you also consider the qurey posted under "reader listner not working ". If required, i can send exe & code files generated by Rhapsody.

 

Regards,

Dhruv