Re: building error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/30/2011 08:34 PM, Wen Congyang wrote:
>>> # rpm -qa 'systemtap*'
>>> systemtap-sdt-devel-1.2-9.el6.x86_64
>>
>> What does STAP_PROBE3 look like in your /usr/include/sys/sdt.h?
>>
> 
> #if ! defined EXPERIMENTAL_KPROBE_SDT
> ....
> #define STAP_PROBE3_(probe,label,parm1,parm2,parm3)			\
> do STAP_SEMAPHORE(probe) {						\
>   STAP_SDT_VOLATILE __typeof__((parm1)) arg1 = parm1;			\
>   STAP_SDT_VOLATILE __typeof__((parm2)) arg2 = parm2;			\
>   STAP_SDT_VOLATILE __typeof__((parm3)) arg3 = parm3;			\

So is it this variant...

> #else /* ! defined EXPERIMENTAL_KPROBE_SDT */
> ...
> #define STAP_PROBE3_(probe,label,parm1,parm2,parm3)			\
> do STAP_SEMAPHORE(probe) {						\
>   __extension__ struct {size_t arg1 __attribute__((aligned(8)));	\
> 	  size_t arg2 __attribute__((aligned(8)));			\
> 	  size_t arg3 __attribute__((aligned(8)));}			\
>   stap_probe3_args = {(size_t)parm1, (size_t)parm2, (size_t)parm3};	\

...or this variant that got used?  Would you mind giving the relevant
portion of gcc -E output around the line that is failing, so we can see
the full macro expansion that the compiler doesn't like?

Looking back at your original report:

remote.c:2043: error: invalid initializer

-          virNetServerClientGetFD(client), REMOTE_AUTH_POLKIT, ident);
+          virNetServerClientGetFD(client), REMOTE_AUTH_POLKIT, (char
*)ident);

and the declaration in question:

    char ident[100];

I'm guessing it's the first variant, and that:

volatile __typeof__(ident) arg3 = ident;

is getting translated to:

volatile char[100] arg3 = ident;

which really is invalid, but that adding the cast to char* fixes things,
so that the compiler is then doing:

volatile char *arg3 = (char*)ident;

And if we really are dealing with a macro that broken, then I'm entirely
in favor of fixing our definition of PROBE to do the casting in advance,
rather than making all PROBE callers worry about broken <sys/sdt.h>.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]