Re: [libunwind] r321440 - [libunwind] Avoid using C++ headers.

2017-12-25 Thread Don Hinton via cfe-commits
On Mon, Dec 25, 2017 at 1:10 PM, whitequark wrote: > On 2017-12-25 20:54, Don Hinton wrote: > >> On Mon, Dec 25, 2017 at 12:43 PM, whitequark >> wrote: >> >>> On 2017-12-25 20:32, Don Hinton wrote: >>> It should also assert for non-integral types. >>> >>> True, but I do not know enough

Re: [libunwind] r321440 - [libunwind] Avoid using C++ headers.

2017-12-25 Thread whitequark via cfe-commits
On 2017-12-25 20:54, Don Hinton wrote: On Mon, Dec 25, 2017 at 12:43 PM, whitequark wrote: On 2017-12-25 20:32, Don Hinton wrote: It should also assert for non-integral types. True, but I do not know enough C++ magic to implement that. AIUI std::numeric_limits implements this by specializing

Re: [libunwind] r321440 - [libunwind] Avoid using C++ headers.

2017-12-25 Thread Don Hinton via cfe-commits
On Mon, Dec 25, 2017 at 12:43 PM, whitequark wrote: > On 2017-12-25 20:32, Don Hinton wrote: > >> While beauty is in the eye of the beholder, I'm not sure introducing a >> new template function in a header that's only used in that header is a >> good idea. Every file that includes DwarfParser.hp

Re: [libunwind] r321440 - [libunwind] Avoid using C++ headers.

2017-12-25 Thread whitequark via cfe-commits
On 2017-12-25 20:32, Don Hinton wrote: While beauty is in the eye of the beholder, I'm not sure introducing a new template function in a header that's only used in that header is a good idea. Every file that includes DwarfParser.hpp is going to get that template function -- and someone may try t

Re: [libunwind] r321440 - [libunwind] Avoid using C++ headers.

2017-12-25 Thread Don Hinton via cfe-commits
While beauty is in the eye of the beholder, I'm not sure introducing a new template function in a header that's only used in that header is a good idea. Every file that includes DwarfParser.hpp is going to get that template function -- and someone may try to use it someday. However, if you did wa

Re: [libunwind] r321440 - [libunwind] Avoid using C++ headers.

2017-12-25 Thread whitequark via cfe-commits
On 2017-12-25 19:43, Don Hinton wrote: Here's the patch I applied locally. hth... don [snip] I've committed a slightly beautified version of the patch (below) as r321446. Cheers! From 8a4760bafc1123f09438587ee5432eabdec3d33d Mon Sep 17 00:00:00 2001 From: whitequark Date: Mon, 25 Dec 2017 20

Re: [libunwind] r321440 - [libunwind] Avoid using C++ headers.

2017-12-25 Thread Don Hinton via cfe-commits
Here's the patch I applied locally. hth... don diff --git a/src/DwarfParser.hpp b/src/DwarfParser.hpp index 518101e..ac4f1c4 100644 --- a/src/DwarfParser.hpp +++ b/src/DwarfParser.hpp @@ -540,7 +540,7 @@ bool CFI_Parser::parseInstructions(A &addressSpace, pint_t instructions, results->cfa

Re: [libunwind] r321440 - [libunwind] Avoid using C++ headers.

2017-12-25 Thread Don Hinton via cfe-commits
On Mon, Dec 25, 2017 at 11:09 AM, whitequark wrote: > On 2017-12-25 19:04, Don Hinton wrote: > >> Hi: >> >> This change breaks in a local debug build, e.g.,: >> >> /Users/dhinton/projects/llvm_project/libunwind/src/DwarfPars >> er.hpp:559:28: >> error: no member named 'numeric_limits' in namespac

Re: [libunwind] r321440 - [libunwind] Avoid using C++ headers.

2017-12-25 Thread whitequark via cfe-commits
On 2017-12-25 19:04, Don Hinton wrote: Hi: This change breaks in a local debug build, e.g.,: /Users/dhinton/projects/llvm_project/libunwind/src/DwarfParser.hpp:559:28: error: no member named 'numeric_limits' in namespace 'std' assert(length < std::numeric_limits::max() && "pointer overflo

Re: [libunwind] r321440 - [libunwind] Avoid using C++ headers.

2017-12-25 Thread Don Hinton via cfe-commits
Hi: This change breaks in a local debug build, e.g.,: /Users/dhinton/projects/llvm_project/libunwind/src/DwarfParser.hpp:559:28: error: no member named 'numeric_limits' in namespace 'std' assert(length < std::numeric_limits::max() && "pointer overflow"); ~^ thanks