Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [lttng-dev] lttng-ust with --std=c99 -pedantic
@ 2012-06-09 23:37 John Steele Scott
  2012-06-12 15:32 ` Mathieu Desnoyers
  0 siblings, 1 reply; 9+ messages in thread
From: John Steele Scott @ 2012-06-09 23:37 UTC (permalink / raw)


I want to add lttng-ust tracepoints to a program which builds with "--std=c99 -pedantic". Right now this does not work.

Using the demo program as an example, if you enable --std=c99, the first issue looks like:

jscott at saaz:~/src/lttng-ust/tests/demo$ ccache gcc -std=c99 -DHAVE_CONFIG_H -I. -I../.. -I../../include/lttng  -I../../include -Wall -g -O2 -MT demo.o -MD -MP -MF .deps/demo.Tpo -c -o demo.o demo.c
In file included from demo.c:34:0:
ust_tests_demo.h: In function ?__tracepoint_cb_ust_tests_demo___starting?:
ust_tests_demo.h:27:23: warning: implicit declaration of function ?typeof? [-Wimplicit-function-declaration]
ust_tests_demo.h:27:218: error: expected ?;? before ?_________p1?
ust_tests_demo.h:27:395: error: ?_________p1? undeclared (first use in this function)
ust_tests_demo.h:27:395: note: each undeclared identifier is reported only once for each function it appears in
In file included from demo.c:34:0:
ust_tests_demo.h: In function ?__tracepoint_cb_ust_tests_demo___done?:
ust_tests_demo.h:35:214: error: expected ?;? before ?_________p1?
ust_tests_demo.h:35:383: error: ?_________p1? undeclared (first use in this function)
In file included from demo.c:35:0:
ust_tests_demo2.h: In function ?__tracepoint_cb_ust_tests_demo2___loop?:
ust_tests_demo2.h:27:299: error: expected ?;? before ?_________p1?
ust_tests_demo2.h:27:470: error: ?_________p1? undeclared (first use in this function)
In file included from demo.c:36:0:
ust_tests_demo3.h: In function ?__tracepoint_cb_ust_tests_demo3___done?:
ust_tests_demo3.h:27:215: error: expected ?;? before ?_________p1?
ust_tests_demo3.h:27:386: error: ?_________p1? undeclared (first use in this function)

This can be easily resolved by using __typeof__() instead of typeof(). Then I can build with --std=c99. But adding -pedantic still fails:

jscott at saaz:~/src/lttng-ust/tests/demo$ ccache gcc -std=c99 -Dtypeof=__typeof__ -pedantic -DHAVE_CONFIG_H -I. -I../.. -I../../include/lttng  -I../../include -Wall -g -O2 -MT demo.o -MD -MP -MF .deps/demo.Tpo -c -o demo.o demo.c
In file included from ust_tests_demo.h:25:0,
                 from demo.c:34:
../../include/lttng/tracepoint.h: In function ?__tracepoints__init?:
../../include/lttng/tracepoint.h:251:4: warning: ISO C forbids conversion of object pointer to function pointer type [-pedantic]
../../include/lttng/tracepoint.h:255:4: warning: ISO C forbids conversion of object pointer to function pointer type [-pedantic]
../../include/lttng/tracepoint.h:260:4: warning: ISO C forbids conversion of object pointer to function pointer type [-pedantic]
../../include/lttng/tracepoint.h:264:4: warning: ISO C forbids conversion of object pointer to function pointer type [-pedantic]
../../include/lttng/tracepoint.h:268:4: warning: ISO C forbids conversion of object pointer to function pointer type [-pedantic]
In file included from demo.c:34:0:
ust_tests_demo.h: In function ?__tracepoint_cb_ust_tests_demo___starting?:
ust_tests_demo.h:27:161: warning: ISO C forbids braced-groups within expressions [-pedantic]
ust_tests_demo.h:27:549: warning: ISO C forbids conversion of object pointer to function pointer type [-pedantic]
In file included from demo.c:34:0:
ust_tests_demo.h: In function ?__tracepoint_cb_ust_tests_demo___done?:
ust_tests_demo.h:35:161: warning: ISO C forbids braced-groups within expressions [-pedantic]
ust_tests_demo.h:35:537: warning: ISO C forbids conversion of object pointer to function pointer type [-pedantic]
In file included from demo.c:35:0:
ust_tests_demo2.h: In function ?__tracepoint_cb_ust_tests_demo2___loop?:
ust_tests_demo2.h:27:245: warning: ISO C forbids braced-groups within expressions [-pedantic]
ust_tests_demo2.h:27:624: warning: ISO C forbids conversion of object pointer to function pointer type [-pedantic]
In file included from demo.c:36:0:
ust_tests_demo3.h: In function ?__tracepoint_cb_ust_tests_demo3___done?:
ust_tests_demo3.h:27:161: warning: ISO C forbids braced-groups within expressions [-pedantic]
ust_tests_demo3.h:27:540: warning: ISO C forbids conversion of object pointer to function pointer type [-pedantic]

This is with 4.6.1-9ubuntu3 on Ubuntu 11.10, lttng-ust master 5a821c.

Would it be particularly difficult to make the lttng-ust tracepoints compatible with programs built with -pedantic?

cheers,

John




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-06-21  0:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-09 23:37 [lttng-dev] lttng-ust with --std=c99 -pedantic 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
2012-06-21  0:51               ` John Steele Scott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox