litespeedtech / litespeedtech/lsquic

Wishlish: fix compiler warnings about shadowed variables

Open
#608 5 comments 1 reaction 2 assignees View on GitHub

@dtikhonov is already working on this.

Since Jan 6, 2026.

build wishlist
Dominant language
C
Stars
1.9k
Forks
397
Avg merge
2d 22h
Merged PRs (30d)
8

Description

https://github.com/litespeedtech/lsquic/blob/342a9b35690ee6c879a9b2e2b02af9a2fe17a1c4/src/liblsquic/lsquic_handshake.c#L79

```
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];
| ^

```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.