Page MenuHomeFreeBSD

Fix lib/libnv tests compilation with -std=c++11
ClosedPublic

Authored by dim on Mar 7 2015, 11:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 30, 6:11 PM
Unknown Object (File)
Tue, Apr 30, 6:11 PM
Unknown Object (File)
Tue, Apr 30, 6:10 PM
Unknown Object (File)
Tue, Apr 30, 5:35 PM
Unknown Object (File)
Tue, Apr 30, 5:34 PM
Unknown Object (File)
Tue, Apr 30, 5:34 PM
Unknown Object (File)
Tue, Apr 30, 5:33 PM
Unknown Object (File)
Fri, Apr 26, 11:02 PM
Subscribers

Details

Summary

In this thread Oliver Hartmann describes an error he gets when compiling
the lib/libnv tests:

https://lists.freebsd.org/pipermail/freebsd-current/2015-March/054858.html

The errors are because the tests use the ATF_REQUIRE_EQ() macro with
NULL as its second argument, and the macro tries to output its arguments
on a std::ostringtream.

However, in C++11 you cannot output a plain NULL to any std::ostream;
you have to qualify the type of pointer by casting it. This is also
what ATF does internally for some of its tests.

I went through all the cases and added the correct casts, and now
lib/libnv can be successfully compiled with -std=c++11.

Test Plan

Compile and run tests.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

dim retitled this revision from to Fix lib/libnv tests compilation with -std=c++11.
dim updated this object.
dim edited the test plan for this revision. (Show Details)
dim added reviewers: rstone, pjd.
dim added a subscriber: jmmv.
rstone edited edge metadata.

Thanks for doing this.

This revision is now accepted and ready to land.Mar 8 2015, 12:01 AM
jmmv added a reviewer: jmmv.
dim updated this revision to Diff 4144.

Closed by commit rS279760 (authored by @dim).