Opened 8 years ago
Closed 8 years ago
#10840 closed Bugs (fixed)
Missing std:: qualifier for puts call in test_7868.cpp
| Reported by: | Owned by: | viboes | |
|---|---|---|---|
| Milestone: | Boost 1.58.0 | Component: | chrono |
| Version: | Boost Development Trunk | Severity: | Problem |
| Keywords: | Cc: |
Description
File libs/chrono/test/test_7868.cpp fails when compiled with Oracle Solaris Studio 12.4 on Solaris 11.2 as follows:
"../libs/chrono/test/test_7868.cpp", line 32: Error: The function "puts" must have a prototype. "../libs/chrono/test/test_7868.cpp", line 32: Error: The function "puts" must have a prototype.
The file test_7868.cpp includes <cstdio>, however the call to puts needs to be qualified with std::.
The diff's for the file are
32c32
< puts(ctime(&t));
---
std::puts(ctime(&t));
Per the C++ standard, including a <cxxxx> header like <cstdio> in this case, the names in these headers are only in the namespace std. Hence they need to be qualified with std::.
Change History (2)
comment:1 by , 8 years ago
| Milestone: | To Be Determined → Boost 1.58.0 |
|---|
comment:2 by , 8 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |

https://github.com/boostorg/chrono/commit/9adab29010e6e6a4d4c4f9004ddd269ebb441115