Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [lttng-dev] lttng-ust with --std=c99 -pedantic
Date: Wed, 20 Jun 2012 09:47:46 -0400	[thread overview]
Message-ID: <20120620134746.GB25924@Krystal> (raw)
In-Reply-To: <4FE1CBB4.7040007@toojays.net>

* John Steele Scott (toojays at toojays.net) wrote:
> On 20/06/12 03:15, Mathieu Desnoyers wrote:
> > * Mathieu Desnoyers (mathieu.desnoyers at efficios.com) wrote:
> >> * John Steele Scott (toojays at toojays.net) wrote:
> >>
> snip snip
> >>> The thing I forgot to mention is: okay, I can build now with
> >>> -pedantic, but I can't build with "-pedantic -Werror". This
> >>> application builds with "--std=c99 -pedantic -Werror" (among many
> >>> other flags). I can of course remove -Werror for my tests, but in the
> >>> longer term I would like to see lttng-ust enabled in our regular
> >>> build, and disabling -Werror for that is not something we want to do.
> >>> If I only had to disable it for the trace provider, I could negotiate
> >>> that, but disabling it for any module which uses tracepoints is
> >>> undesirable.
> >>>
> >>> I haven't yet looked at how difficult it would be do eliminate these
> >>> pedantic warnings. Do you have a feel for what is involved?
> >>> Preprocessor tricks warp my mind. :(
> >> I don't think we'll want to make the lttng probe module build under
> >> --std=c99 -pedandic -Werror, but I think we should focus on making sure
> >> the tracepoint part that is built within the application (with
> >> TRACEPOINT_CREATE_PROBES _not_ defined) builds fine in --std=c99
> >> -pedantic.
> >>
> >> Currently, building a simple test program with tracepoints under
> >> --std=c99 -pedantic gets me:
> >>
> >>
> >> In file included from ust_tests_hello.h:25:0,
> >>                  from hello.c:34:
> >> ../../include/lttng/tracepoint.h: In function ?__tracepoints__init?:
> >> ../../include/lttng/tracepoint.h:261:3: warning: ISO C forbids conversion of object pointer to function pointer type [-pedantic]
> >> ../../include/lttng/tracepoint.h:265:3: warning: ISO C forbids conversion of object pointer to function pointer type [-pedantic]
> >> ../../include/lttng/tracepoint.h:270:3: warning: ISO C forbids conversion of object pointer to function pointer type [-pedantic]
> >> ../../include/lttng/tracepoint.h:274:3: warning: ISO C forbids conversion of object pointer to function pointer type [-pedantic]
> >> ../../include/lttng/tracepoint.h:278:3: warning: ISO C forbids conversion of object pointer to function pointer type [-pedantic]
> >>
> >> ---> see include/lttng/tracepoint.h __tracepoints__init():
> >> ----> This is caused by use of dlsym() to lookup a function pointer from
> >>       a symbol. dlsym() returns "void *", and we cast it into function
> >>       pointer type. Ideas on how to make this c99 pedantic compliant are
> >>       welcome.
> 
> I found this warning discussed in a GCC bug report. Jakub Jelinek's suggestion at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45289#c6 (load the result of dlsym into a void *, then memcpy to the function pointer), does make these go away (using GCC 4.4.6 on Centos 6.2).

Can you check if these can be reproduced with gcc 4.5 or 4.6 ? (without
the memcpy trick)

The bugzilla entry seems to imply that the warning went away from
-pedantic mode at some point.

Thanks,

Mathieu

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com



  reply	other threads:[~2012-06-20 13:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-09 23:37 John Steele Scott
2012-06-12 15:32 ` Mathieu Desnoyers
2012-06-12 15:55   ` Mathieu Desnoyers
2012-06-18 12:10     ` John Steele Scott
2012-06-18 14:11       ` Mathieu Desnoyers
2012-06-19 17:45         ` Mathieu Desnoyers
2012-06-20 13:10           ` John Steele Scott
2012-06-20 13:47             ` Mathieu Desnoyers [this message]
2012-06-21  0:51               ` John Steele Scott

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120620134746.GB25924@Krystal \
    --to=mathieu.desnoyers@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox