Harness header hygiene: trailing semicolons, name collisions, argument capture

Đang mở
#423 0 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
50/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c, cpp, rust
Lĩnh vực
embedded-iot, testing-qa

Hướng nghiên cứu

Start by inspecting the listed harness/tsffs-*.h and harness/tsffs.h macro definitions, then check harness/test.sh:25-26 and the MSVC C++ branch. Compare tsffs-gcc-x86.h with tsffs-gcc-x86_64.h and the riscv32/riscv64 headers; verify the reported issues with focused compile cases, including if (x) HARNESS_STOP(); else ... and an argument named value. Done means the listed header and script issues are corrected and the harness checks pass.

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

Mô tả

Where

  • all harness/tsffs-*.h and harness/tsffs.h

Problem

  • All macro bodies end in } while (0);, breaking if (x) HARNESS_STOP(); else ....
  • x86 headers define __cpuid (collides with <cpuid.h>/<intrin.h>); arm headers define __stringify (collides with linux/stringify.h).
  • The local value in x86 macros captures a user argument named value: HARNESS_START_WITH_MAXIMUM_SIZE(buf, value) passes the magic number.
  • tsffs-gcc-x86.h duplicates tsffs-gcc-x86_64.h; riscv32/riscv64 differ only in whitespace.
  • harness/test.sh:25-26 missing / in rm paths; MSVC C++ branch uses size_t with only <cstdint>.

Impact
Compile errors or silent miscompiles in user harnesses.

Suggested fix
Drop the trailing ;, prefix internal helpers with __tsffs_, rename the macro local, dedupe identical headers.

Related
#394, #379 (arm32 index)

Status
Reported by static code review at 79972db; not yet re-verified line by line. Found by reading the code; not reproduced under SIMICS.

Ngôn ngữ chính
Rust
Star
335
Fork
26
Merge trung bình
1 ngày 50 phút
Pull request đã merge (30 ngày)
12

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 intel/tsffs

Tất cả issue của intel/tsffs

Issue tương tự

Thêm issue về Rust

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.