Draft: Modernize C-style casts and disallow their use in ns-3

Overview

This MR replaces unsafe C-style casts with static_cast (and reinterpret_cast where appropriate) across several core modules to improve type safety and conform to modern C++ standards.

  • Issue: Addresses #1315
  • Enforcement: Added cppcoreguidelines-pro-type-cstyle-cast clang-tidy check and -Wold-style-cast build flag to catch future regressions.

Updated Modules

  • Core & Infrastructure: core, config-store, stats, mpi
  • Networking & Devices: network, internet, traffic-control, csma, fd-net-device, tap-bridge, sixlowpan, nix-vector-routing, netanim, internet-apps
  • Wireless & Mobility: wifi, mesh, antenna, spectrum, mobility, buildings, lr-wpan, uan
  • Routing & Applications: applications, openflow, click, olsr, aodv, dsdv, dsr
  • Utilities: flow-monitor, topology-read, brite

Note: This MR is part of an ongoing effort — the lte module remains to be updated. CI is currently skipped.

Development and Merge Strategy

Since this MR fixes #1315, requires changes to all modules, it will be split into multiple individual MRs. Each MR will be reviewed individually and merged as soon as it is ready. Then, after all modules have been fixed, this MR will apply the enforcement of this coding style.

The individual MRs are listed below:

Edited by Shivang Upadhyay

Merge request reports

Loading
Loading