[lttng-dev] GSoC 2013, "C++ probe support" project and more

Zifei Tong soariez at gmail.com
Sat Apr 20 08:29:17 EDT 2013

On Fri, Apr 19, 2013 at 1:38 PM, Zifei Tong <soariez at gmail.com> wrote:
> While for g++, since it does not support C's designated initializer
> (clang++ does), further work shall be done. All remaining errors are
> related to this struct initializer issue
> (https://gist.github.com/5kg/5417850), can anyone suggest a clean hack
> to workaround this?

I did some research on designated initializer today, and finally made
g++ compile 'hello.cxx' example.

G++ do support designated initializer, however only 'trivial
designated initializers' are supported, otherwise it will complain:
'sorry, unimplemented: non-trivial designated initializers not

After some trial-and-error, it seems that 'trivial designated
initializers' means no out-of-order initialization and 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}.

So I reordered some initializers, add some fields, and change nested
initializations in the above odd form to make g++ happy.

I've uploaded a patch to: http://bugs.lttng.org/issues/338

Could you please review it?

Best Regards,
仝子飞 (Zifei Tong)
College of Computer Science and Technology, Zhejiang University

soariez at gmail.com / tongzifei at zju.edu.cn

More information about the lttng-dev mailing list