Opened 13 years ago

Closed 12 years ago

#3962 closed Bugs (fixed)

filesystem operations.cpp calls std::malloc but does not include <cstdlib>

Reported by: stephen.clamage@… Owned by: Beman Dawes
Milestone: Boost 1.43.0 Component: filesystem
Version: Boost 1.42.0 Severity: Problem
Keywords: Cc:

Description

In the filesystem library, file operations.cpp calls std::malloc without having included either <cstdlib> or <stdlib.h>. The code can work by accident if one of the standard library headers includes <stdlib.h> or <cstdlib>, but you can't depend on it. The code fails to compile using Apache stdcxx due to the missing header.

The C++ rule is that if you use a declaration from a standard header, you must explicitly include that header. Reference: C++ 2003 standard, section 17.4.2.1 "Headers".

Change History (1)

comment:1 by Beman Dawes, 12 years ago

Resolution: fixed
Status: newclosed

(In [62220]) Fix #3962

Note: See TracTickets for help on using tickets.