Build warnings

Đang mở
#490 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
cpp
Lĩnh vực
databases

Hướng nghiên cứu

Tái hiện các cảnh báo với các cờ CMake được tăng cường và kiểm tra các định nghĩa bộ đệm được báo cáo trong boost/mysql/impl/format_sql.ipp cùng các hàm định dạng trong boost/mysql/impl/internal/dt_to_string.hpp. Xác định xem các chẩn đoán có chỉ ra một lỗi tràn bộ đệm thực sự hay không, sau đó xác minh rằng cảnh báo đã được giải quyết mà không thay đổi hành vi định dạng datetime và time được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Hi

I'm using 1.87.0 and my CI is showing the following:

In function 'write_pad2',
    inlined from 'datetime_to_string' at /usr/local/include/boost/mysql/impl/internal/dt_to_string.hpp:125:20,
    inlined from 'append_quoted_datetime' at /usr/local/include/boost/mysql/impl/format_sql.ipp:195:48,
    inlined from 'append_field_view' at /usr/local/include/boost/mysql/impl/format_sql.ipp:254:61:
/usr/local/include/boost/mysql/impl/internal/dt_to_string.hpp:47:18: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
   47 |         *begin++ = '0';
      |                  ^
/usr/local/include/boost/mysql/impl/format_sql.ipp: In function 'append_field_view':
/usr/local/include/boost/mysql/impl/format_sql.ipp:193:10: note: at offset 66 into destination object 'buffer' of size 66
  1[93](https://git.zentrack.cl/zentrack/server/-/jobs/1345#L93) |     char buffer[66];
      |          ^
In function 'write_pad2',
    inlined from 'datetime_to_string' at /usr/local/include/boost/mysql/impl/internal/dt_to_string.hpp:129:20,
    inlined from 'append_quoted_datetime' at /usr/local/include/boost/mysql/impl/format_sql.ipp:1[95](https://git.zentrack.cl/zentrack/server/-/jobs/1345#L95):48,
    inlined from 'append_field_view' at /usr/local/include/boost/mysql/impl/format_sql.ipp:254:61:
/usr/local/include/boost/mysql/impl/internal/dt_to_string.hpp:47:18: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
   47 |         *begin++ = '0';
      |                  ^
/usr/local/include/boost/mysql/impl/format_sql.ipp: In function 'append_field_view':
/usr/local/include/boost/mysql/impl/format_sql.ipp:193:10: note: at offset 66 into destination object 'buffer' of size 66
  193 |     char buffer[66];
      |          ^
In function 'write_pad2',
    inlined from 'time_to_string' at /usr/local/include/boost/mysql/impl/internal/dt_to_string.hpp:174:20,
    inlined from 'append_quoted_time' at /usr/local/include/boost/mysql/impl/format_sql.ipp:213:36,
    inlined from 'append_field_view' at /usr/local/include/boost/mysql/impl/format_sql.ipp:255:53:
/usr/local/include/boost/mysql/impl/internal/dt_to_string.hpp:47:18: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
   47 |         *begin++ = '0';
      |                  ^
/usr/local/include/boost/mysql/impl/format_sql.ipp: In function 'append_field_view':
/usr/local/include/boost/mysql/impl/format_sql.ipp:211:10: note: at offset 66 into destination object 'buffer' of size 66
  211 |     char buffer[66];
      |          ^
In function 'write_pad2',
    inlined from 'time_to_string' at /usr/local/include/boost/mysql/impl/internal/dt_to_string.hpp:178:20,
    inlined from 'append_quoted_time' at /usr/local/include/boost/mysql/impl/format_sql.ipp:213:36,
    inlined from 'append_field_view' at /usr/local/include/boost/mysql/impl/format_sql.ipp:255:53:
/usr/local/include/boost/mysql/impl/internal/dt_to_string.hpp:47:18: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
   47 |         *begin++ = '0';
      |                  ^
/usr/local/include/boost/mysql/impl/format_sql.ipp: In function 'append_field_view':
/usr/local/include/boost/mysql/impl/format_sql.ipp:211:10: note: at offset 66 into destination object 'buffer' of size 66
  211 |     char buffer[66];
      |          ^

I've several hardened flags:

    set(HARDENED_FLAGS
            -Wall -Wextra -Wpedantic -Werror
            -Wshadow -Wnull-dereference -Wdouble-promotion
            -Wconversion -Wsign-conversion -Wold-style-cast
            -Wnon-virtual-dtor -Woverloaded-virtual -Wuseless-cast
            -Wcast-align -Wcast-qual -Wstrict-aliasing=2
            -Waligned-new=all -Wduplicated-cond -Wduplicated-branches
            -Wlogical-op -Wmissing-declarations -Wredundant-decls
            -fsanitize=address,undefined,leak,signed-integer-overflow
            -fno-omit-frame-pointer
            -D_FORTIFY_SOURCE=2
    )

    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g --coverage -fsanitize=address,undefined,leak,signed-integer-overflow -fno-omit-frame-pointer")

This is a concern?

Ngôn ngữ chính
C++
Star
297
Fork
43
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
20

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của boostorg/mysql

Tất cả issue của boostorg/mysql

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.