[cfe-dev] Goal for 3.5: Library-friendly headers

Chris Lattner clattner at apple.com
Mon Nov 11 22:20:14 PST 2013

On Nov 11, 2013, at 12:09 PM, Alp Toker <alp at nuanti.com> wrote:

>> Even when you have a !NDEBUG build, the platform assert() is pretty
>> crummy on Windows and generates, at best a UTF-16 dump, or sometimes
>> just pops up a dialog. WebKit and other projects take the same approach
>> and define their own assertion macros to deal with this portably.
>> So as far as I can tell, as long as the headers use assert(), they need
>> to use our own version in order for the definition to match.
> Chris,
> Having said that, I agree it's worth trying without llvm_assert() to see
> how far it gets.
> I'll pull together a rework of this patchset with just the build system
> and structure changes alone to see how far it gets.
> The key thing then is to make sure that it's safe to enable the
> assertions in the headers if an application is built with !NDEBUG and
> linked against an NDEBUG version of LLVM.

Sounds great.  I'm pretty confident that there will be no problems - in practice - from any ODR violations that might arise from "assert" differing across library boundaries.  We would want some pretty strong practical justification for breaking away from standard assert.


More information about the cfe-dev mailing list