Bug 100297 - [patch] fix name clash of assert macro in debug.hpp with libc's assert macro
Péter Radics
mitchnull at gmail.com
Tue Feb 19 07:55:15 PST 2013
Hello,
hotspot/src/share/vm/utilities/debug.hpp defines an assert macro with two
parameters. This macro definition clashes with libc's assert macro from
<assert.h> (and to the best of my knowledge it's undefined behavior to
redefine
assert like this).
The name clash causes build failures if any of the files using debug.hpp
directly or indirectly include <assert.h> (or <cassert>), too.
This doesn't seem to happen with libstdc++ (yet?), but this error is
triggered if
trying to build with libc++ (http://libcxx.llvm.org).
I propose changing the name of the assert macro defined in debug.hpp to
assert_vm (based on the fact that this macro is used solely in the vm
subsystem).
I've created a set of patches and attached it to issue 100297:
https://bugs.openjdk.java.net/show_bug.cgi?id=100297
I believe libc++ will be used by more and more systems in the near future
(as far as I
know FreeBSD is planning to include it as the default c++ lib in a coming
release), so
it would be worthwhile fixing this issue.
cheers,
mitch
More information about the hotspot-dev
mailing list