Commit 85b26bdb authored by jan.koester's avatar jan.koester
Browse files

Fix remaining compiler warnings (v22)

parent 93bf4e4d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
libnetplus (20260424+22) unstable; urgency=medium

  * Fix remaining compiler warnings: remove unused derOctetString, enlarge
    snprintf buffer in derUtcTime, remove unused label in epoll.cpp,
    suppress GCC 14 false-positive -Wfree-nonheap-object in tls.cpp/quic.cpp

 -- Jan Koester <jan.koester@tuxist.de>  Thu, 24 Apr 2026 18:00:00 +0200

libnetplus (20260424+21) unstable; urgency=medium

  * Fix compiler warnings: remove unused debug variables in quic.cpp
+3 −0
Original line number Diff line number Diff line
@@ -3911,6 +3911,8 @@ namespace netplus {
        (*seqp)++;
    }

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
    void tls::tls13_send_handshake(uint8_t hs_type,
                                   const std::vector<uint8_t>& hs_body,
                                   bool handshake_keys)
@@ -3930,6 +3932,7 @@ namespace netplus {
        // inner content type must be HANDSHAKE (0x16)
        tls13_send_record(0x16, msg, handshake_keys);
    }
#pragma GCC diagnostic pop

    // =================================================================
    // TLS 1.3 Certificate and Verify
+0 −1
Original line number Diff line number Diff line
@@ -231,7 +231,6 @@ namespace netplus {
                _ServerSocket->accept(ccon->slots[0].csock, true);
                if (!ccon || !ccon->slots[0].csock) return;

            register_connection:
                // accept4(SOCK_NONBLOCK) already sets non-blocking in tcp::accept
                int fd = ccon->slots[0].csock->fd();

+3 −0
Original line number Diff line number Diff line
@@ -3656,8 +3656,11 @@ void quic::sendStreamData(uint64_t stream_id, const std::vector<uint8_t>& data,
            if (set_fin) frame_type |= 0x01;

            std::vector<uint8_t> frame;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
            frame.reserve(frame_hdr_max + chunk_len);
            frame.push_back(frame_type);
#pragma GCC diagnostic pop

            uint8_t varint_buf[8];
            size_t bytes = encodeVarInt(stream_id, varint_buf);
+1 −5
Original line number Diff line number Diff line
@@ -119,10 +119,6 @@ static std::vector<uint8_t> derBitString(const std::vector<uint8_t> &bits) {
    return derTag(0x03, content);
}

static std::vector<uint8_t> derOctetString(const std::vector<uint8_t> &data) {
    return derTag(0x04, data);
}

static std::vector<uint8_t> derUtf8String(const std::string &s) {
    std::vector<uint8_t> data(s.begin(), s.end());
    return derTag(0x0C, data);
@@ -140,7 +136,7 @@ static std::vector<uint8_t> derUtcTime(time_t t) {
#else
    gmtime_r(&t, &utc);
#endif
    char buf[16];
    char buf[64];
    snprintf(buf, sizeof(buf), "%02d%02d%02d%02d%02d%02dZ",
             utc.tm_year % 100, utc.tm_mon + 1, utc.tm_mday,
             utc.tm_hour, utc.tm_min, utc.tm_sec);