Skip to content

Wishlish: fix compiler warnings about shadowed variables #608

Description

@marakew

static const struct lsquic_conn *const lconn = &dummy_lsquic_conn;

D:/lsquic/src/liblsquic/lsquic_handshake.c:796:55: warning: declaration shadows a variable in the global scope [-Wshadow]
  796 | lsquic_enc_session_create_client (struct lsquic_conn *lconn, const char *domain,
      |                                                       ^
D:/lsquic/src/liblsquic/lsquic_handshake.c:79:40: note: previous declaration is here
   79 | static const struct lsquic_conn *const lconn = &dummy_lsquic_conn;
      |                                        ^
D:/lsquic/src/liblsquic/lsquic_handshake.c:874:55: warning: declaration shadows a variable in the global scope [-Wshadow]
  874 | lsquic_enc_session_create_server (struct lsquic_conn *lconn, lsquic_cid_t cid,
      |                                                       ^
D:/lsquic/src/liblsquic/lsquic_handshake.c:79:40: note: previous declaration is here
   79 | static const struct lsquic_conn *const lconn = &dummy_lsquic_conn;
      |                                        ^
D:/lsquic/src/liblsquic/lsquic_handshake.c:3162:55: warning: declaration shadows a variable in the global scope [-Wshadow]
 3162 |                             const struct lsquic_conn *lconn,
      |                                                       ^
D:/lsquic/src/liblsquic/lsquic_handshake.c:79:40: note: previous declaration is here
   79 | static const struct lsquic_conn *const lconn = &dummy_lsquic_conn;
      |                                        ^
D:/lsquic/src/liblsquic/lsquic_handshake.c:3691:31: warning: declaration shadows a variable in the global scope [-Wshadow]
 3691 |     const struct lsquic_conn *lconn, struct lsquic_packet_out *packet_out,
      |                               ^
D:/lsquic/src/liblsquic/lsquic_handshake.c:79:40: note: previous declaration is here
   79 | static const struct lsquic_conn *const lconn = &dummy_lsquic_conn;
      |                                        ^
D:/lsquic/src/liblsquic/lsquic_handshake.c:3768:31: warning: declaration shadows a variable in the global scope [-Wshadow]
 3768 |     struct lsquic_conn *const lconn = enc_session->es_conn;
      |                               ^
D:/lsquic/src/liblsquic/lsquic_handshake.c:79:40: note: previous declaration is here
   79 | static const struct lsquic_conn *const lconn = &dummy_lsquic_conn;
      |                                        ^
D:/lsquic/src/liblsquic/lsquic_handshake.c:3806:29: warning: declaration shadows a variable in the global scope [-Wshadow]
 3806 |         struct lsquic_conn *lconn, struct lsquic_packet_out *packet_out)
      |                             ^
D:/lsquic/src/liblsquic/lsquic_handshake.c:79:40: note: previous declaration is here
   79 | static const struct lsquic_conn *const lconn = &dummy_lsquic_conn;
      |                                        ^
D:/lsquic/src/liblsquic/lsquic_handshake.c:3851:71: warning: declaration shadows a variable in the global scope [-Wshadow]
 3851 | gquic_esf_set_conn (enc_session_t *enc_session_p, struct lsquic_conn *lconn)
      |                                                                       ^
D:/lsquic/src/liblsquic/lsquic_handshake.c:79:40: note: previous declaration is here
   79 | static const struct lsquic_conn *const lconn = &dummy_lsquic_conn;
      |                                        ^
D:/lsquic/src/liblsquic/lsquic_handshake.c:3979:31: warning: declaration shadows a variable in the global scope [-Wshadow]
 3979 |     struct lsquic_conn *const lconn = enc_session->es_conn;
      |                               ^
D:/lsquic/src/liblsquic/lsquic_handshake.c:79:40: note: previous declaration is here
   79 | static const struct lsquic_conn *const lconn = &dummy_lsquic_conn;
      |                                        ^
D:/lsquic/src/liblsquic/lsquic_handshake.c:4164:71: warning: declaration shadows a variable in the global scope [-Wshadow]
 4164 |         struct lsquic_engine_public *enpub, const struct lsquic_conn *lconn,
      |                                                                       ^

D:/lsquic/src/liblsquic/lsquic_handshake.c:79:40: note: previous declaration is here
   79 | static const struct lsquic_conn *const lconn = &dummy_lsquic_conn;
      |                                        ^

15 warnings generated.

D:/lsquic/src/liblsquic/lsquic_full_conn_ietf.c:7086:9: warning: declaration shadows a local variable [-Wshadow]
 7086 |         LSQ_DEBUGC("current SCID: %"CID_FMT, CID_BITS(CN_SCID(&conn->ifc_conn)));
      |         ^
D:/lsquic/src/liblsquic\lsquic_logger.h:229:27: note: expanded from macro 'LSQ_DEBUGC'
  229 | #define LSQ_DEBUGC(...)   LSQ_LOGC(LSQ_LOG_DEBUG,  __VA_ARGS__)
      |                           ^
D:/lsquic/src/liblsquic\lsquic_logger.h:208:25: note: expanded from macro 'LSQ_LOGC'
  208 | #       define LSQ_LOGC LSQ_LOG2C
      |                         ^
D:/lsquic/src/liblsquic\lsquic_logger.h:159:18: note: expanded from macro 'LSQ_LOG2C'
  159 |             char cidbuf_[MAX_CID_LEN * 2 + 1];                               \
      |                  ^
D:/lsquic/src/liblsquic/lsquic_full_conn_ietf.c:7061:10: note: previous declaration is here
 7061 |     char cidbuf_[MAX_CID_LEN * 2 + 1];
      |          ^
D:/lsquic/src/liblsquic/lsquic_full_conn_ietf.c:7087:9: warning: declaration shadows a local variable [-Wshadow]
 7087 |         LSQ_DEBUGC("packet in DCID: %"CID_FMT"; changed: %d",
      |         ^
D:/lsquic/src/liblsquic\lsquic_logger.h:229:27: note: expanded from macro 'LSQ_DEBUGC'
  229 | #define LSQ_DEBUGC(...)   LSQ_LOGC(LSQ_LOG_DEBUG,  __VA_ARGS__)
      |                           ^
D:/lsquic/src/liblsquic\lsquic_logger.h:208:25: note: expanded from macro 'LSQ_LOGC'
  208 | #       define LSQ_LOGC LSQ_LOG2C
      |                         ^
D:/lsquic/src/liblsquic\lsquic_logger.h:159:18: note: expanded from macro 'LSQ_LOG2C'
  159 |             char cidbuf_[MAX_CID_LEN * 2 + 1];                               \
      |                  ^
D:/lsquic/src/liblsquic/lsquic_full_conn_ietf.c:7061:10: note: previous declaration is here
 7061 |     char cidbuf_[MAX_CID_LEN * 2 + 1];
      |          ^

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions