Trond Norbye
2008-Mar-05 09:51 UTC
[dtrace-discuss] dtrace -h drops const qualifier from the probe spec..
Hi Is there a valid reason for why dtrace -h removes the const qualifier? provider foo { probe bar(const void*); }; The signature in the generated header-file generated by dtrace -hs foo.d looks like: extern void __dtrace_foo___bar(void *); Why is the const qualifier removed? Is this a bug or a "feature"? I am getting compiler warnings since I am passing const-variables to my probes, and I don''t want to add a cast just to get rid of the warning... Trond
Adam Leventhal
2008-Mar-05 19:27 UTC
[dtrace-discuss] dtrace -h drops const qualifier from the probe spec..
On Wed, Mar 05, 2008 at 10:51:32AM +0100, Trond Norbye wrote:> Hi > > Is there a valid reason for why dtrace -h removes the const qualifier? > > provider foo { > probe bar(const void*); > }; > > The signature in the generated header-file generated by dtrace -hs > foo.d looks like: > > extern void __dtrace_foo___bar(void *); > > Why is the const qualifier removed? Is this a bug or a "feature"?This is a bug. You filed it in 2006: 6460581 dtrace -h drops const qualifier in the generated function prototypes It''s kind of a pain to fix, but I''ll try to bump it up in the queue. It should just be a matter of tinkering with dt_decl_type(), but dealing with all the different ways you can apply const (e.g. const char const *) will be tricky. Adam -- Adam Leventhal, Fishworks http://blogs.sun.com/ahl
Trond Norbye
2008-Mar-05 20:18 UTC
[dtrace-discuss] dtrace -h drops const qualifier from the probe spec..
On Mar 5, 2008, at 8:27 PM, Adam Leventhal wrote:> On Wed, Mar 05, 2008 at 10:51:32AM +0100, Trond Norbye wrote: >> Hi >> >> Is there a valid reason for why dtrace -h removes the const >> qualifier? >> >> provider foo { >> probe bar(const void*); >> }; >> >> The signature in the generated header-file generated by dtrace -hs >> foo.d looks like: >> >> extern void __dtrace_foo___bar(void *); >> >> Why is the const qualifier removed? Is this a bug or a "feature"? > > This is a bug. You filed it in 2006: > > 6460581 dtrace -h drops const qualifier in the generated function > prototypes > > It''s kind of a pain to fix, but I''ll try to bump it up in the queue. > It should > just be a matter of tinkering with dt_decl_type(), but dealing with > all the > different ways you can apply const (e.g. const char const *) will be > tricky.Thank you :-) I had totally forgot that I filed it, and I didn''t see it when I did a quick search today.. How could I miss that! I guess that I need to get new glasses ;) Trond