On Sat, 31 May 2014, Brent Cook wrote:
> with pqueue moving to a private interface, the typedef can occur twice
>
> ../include/openssl/dtls1.h:147:25: error: redefinition of typedef 'pqueue' is
> a C11 feature [-Werror,-Wtypedef-redefinition]
> typedef struct _pqueue *pqueue;
> ^
> ../include/pqueue.h:63:25: note: previous definition is here
> typedef struct _pqueue *pqueue;
It would be better to just eliminate the typedef from the public header,
IMO. Since pqueue is a private interface and the header defining the
struct isn't even exported, there's no (sane) way for someone else to use
the typedef.
(Side note: a #define like HAVE_STRUCT_PQUEUE not only falls in the
application namespace, but in the namespace that autohell squats on, make
it a bad choice for anything not related to autohell.)
Philip Guenther
Index: dtls1.h
===================================================================
RCS file: /cvs/src/lib/libssl/src/ssl/dtls1.h,v
retrieving revision 1.11
diff -u -p -r1.11 dtls1.h
--- dtls1.h 30 May 2014 14:30:50 -0000 1.11
+++ dtls1.h 1 Jun 2014 20:56:03 -0000
@@ -144,11 +144,10 @@ struct dtls1_timeout_st {
};
struct _pqueue;
-typedef struct _pqueue *pqueue;
typedef struct record_pqueue_st {
unsigned short epoch;
- pqueue q;
+ struct _pqueue *q;
} record_pqueue;
typedef struct hm_fragment_st {
@@ -191,10 +190,10 @@ typedef struct dtls1_state_st {
record_pqueue processed_rcds;
/* Buffered handshake messages */
- pqueue buffered_messages;
+ struct _pqueue *buffered_messages;
/* Buffered (sent) handshake records */
- pqueue sent_messages;
+ struct _pqueue *sent_messages;
/* Buffered application records.
* Only for records between CCS and Finished