Skip to content

fix: compilation error due to missing cstdlib header in cli_args.cpp #8088

@karan-singare

Description

@karan-singare

Problem

The src/realm/util/cli_args.cpp file uses std::strtol function on line 67 but doesn't include the <cstdlib> header where this function is defined. This causes compilation errors in some environments.

Current Code

#include <algorithm>
#include <cerrno>
#include <cstdint>
#include <string>
// Missing: #include <cstdlib>

// Line 67 uses std::strtol without proper header
int64_t val = std::strtol(m_value.data(), nullptr, 10);

Expected Solution

Add the missing header:

#include <algorithm>
#include <cstdlib>  // Add this line
#include <cerrno>
#include <cstdint>
#include <string>

Impact

  • Build compatibility: Fixes compilation issues across different platforms
  • No breaking changes: Simple header addition
  • Low risk: Minimal change with clear benefit

Labels

  • bug
  • build
  • good first issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions