Skip to content

Latest commit

 

History

History
60 lines (49 loc) · 2.07 KB

updates.md

File metadata and controls

60 lines (49 loc) · 2.07 KB

TreeMaker Build Status Updates

Last Updated: 2025-01-29

Current Build Status

The project now builds successfully but has several warnings that should be addressed.

Remaining Issues

1. Integer to Pointer Cast Warnings (High Priority)

Location: wnmemg.c - Several casts from integer types to pointer types - Potential issues on 64-bit systems - Risk of memory corruption - Found in macros like WN_FREE_BLOCK_TO_MBHANDLE

FIXED: Memory management code has been updated to be 64-bit safe:

  • Replaced int with size_t for memory sizes
  • Properly aligned structures using max_align_t
  • Removed unsafe integer-to-pointer casts
  • Added proper alignment checks
  • Used flexible array members and offsetof for safe pointer arithmetic

2. Unsafe String Function Usage (Medium Priority)

Location: wnasrt.c

  • Using deprecated sprintf function
  • Security vulnerability risk
  • Should be replaced with snprintf
  • Multiple instances throughout assertion handling code

3. Format String Mismatches (Medium Priority)

Locations:

  • wnrnd.c: Mismatch between format specifier and argument type
  • wnmem.c: Extra arguments in format string
  • Need to ensure proper type matching for printf-family functions

4. String Literal Conversions (Low Priority)

Location: wnmem.c

  • String literals being converted to char*
  • Not compliant with C++11 standard
  • Should be marked as const char*
  • Affects string handling in memory management code

5. Deprecated Register Keyword (Low Priority)

Location: Multiple files in wnlib

  • Using deprecated register storage class specifier
  • Not compatible with C++17
  • Style/modernization issue
  • No functional impact, but should be cleaned up

Next Steps

  1. Replace unsafe string functions with secure alternatives
  2. Fix format string mismatches
  3. Update string literal handling for C++11 compliance
  4. Remove deprecated register keywords

Notes

  • All warnings appear in the wnlib library code
  • Most issues are related to modernizing legacy C code in a C++ environment
  • No functional issues in the core TreeMaker code