]> git.lttng.org Git - lttng-ust.git/commit
Allow tracepoint providers to be compiled with g++
authorZifei Tong <soariez@gmail.com>
Thu, 30 May 2013 14:11:52 +0000 (10:11 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 30 May 2013 14:11:52 +0000 (10:11 -0400)
commit46d522007b647e0b64d18d0ed518205c2bbad424
treee3ffea8a63cc4505ae28a96af60486f2f22288bc
parent996aeadece97a55e7f48ca1e73958a53de62ed4f
Allow tracepoint providers to be compiled with g++

Move enumeration definition out of lttng_ust_lib_ring_buffer_config to
make them visible at global scope for C++ compilers.

Modify designated initializers: reordering initializers, add missing
initializers, reformat nested initializers, in order to make g++
compile.

Relevant discussion:

> So each field need to be listed ? We usually don't put NULL
> initialization for structures that are always in zero-initialized
> memory. (coding style)

This is related to a known issue of g++:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55606 (Bug 55606 - sorry,
unimplemented: non-trivial designated initializers not supported).

g++'s 'trivial designated initializers' means no out-of-order
initialization, no missing
initialization (except the fields on the tail of a struct), and nested
initialization should be done in the form {.foo = {.bar = 1}} instead of
{.foo.bar = 1}. That's why I made such modification.

> Are those changes also compatible with the LLVM c++ compiler ?
Actually, clang++ have designated initializers better supported than g++.
All the modification about designated initializers are not required for
clang++. No need to add NULL initialization, reorder initializations or
change {.foo.bar = 1} into {.foo = {.bar = 1}}. These (ugly) hacks are just
to make g++ happy.

[ Updates done by Mathieu Desnoyers to fix merge conflicts. Updated
  README. ]

Fixes #338

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
README
include/lttng/ringbuffer-config.h
include/lttng/tracepoint-event.h
include/lttng/ust-events.h
include/lttng/ust-tracepoint-event.h
tests/hello.cxx/Makefile.am
tests/hello.cxx/tp.c [deleted file]
tests/hello.cxx/tp.cpp [new file with mode: 0644]
This page took 0.029143 seconds and 4 git commands to generate.