Anonymous typedefs in implementation

13 views
Skip to first unread message

Erich Fuchs

unread,
Aug 24, 2017, 10:12:15 AM8/24/17
to libmodbus
Hey all,

I'm using libmodbus in c++ and want to wrap a class around the lib.
Therefore I want to forward declare the struct to provide encapsulation.

However some typedefs are anonymous like the modbus_mapping_t that makes a forward declaration without a workaround impossible.
What I mean is:

typedef struct {
    ...
} modbus_mapping_t;

Instead of

typedef struct (e.g.) _modbus_mapping {
    ...
} modbus_mapping_t;

Therefore I'm curious about the reason why these typedefs are anonymous.

Cheers,
Erich

Stéphane Raimbault

unread,
Nov 27, 2017, 6:11:08 AM11/27/17
to libm...@googlegroups.com
No reason for that. We should name them.

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "libmodbus".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse libmodbus+unsubscribe@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages