Re: multiple declaration of "foo"
| From: | Xinchen Hui | Date: | Thu, 01 Sep 2011 10:52:27 +0000 |
| Subject: | Re: multiple declaration of "foo" | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-8503@lists.php.net to get a copy of this message | ||
hi
declare with static before 5.3
thanks
Sent from my iPhone
在 2011-9-1,18:40,Miroslav Kubelík <koubel@php.net> 写道:
> Hello, I have some newbie "C" question:
>
> I have two *.c files as part of my extension. In both I have these declarations:
>
> a.c
>
> ZEND_BEGIN_ARG_INFO_EX(arginfo_construct, ...
>
> b.c
>
> ZEND_BEGIN_ARG_INFO(arginfo_construct, ...
>
> I think it's correct because both are expanded to:
> static const zend_arg_info arginfo_construct[] ...
> and it's correct to have two symbols with same names in two "modules" - *..c
> files, isn't it?
>
> but some users complain for linker warnings:
>
> .libs/b.o:(.data.rel.local+0x80): multiple definition of
> `arginfo_construct'
> .libs/a.o:(.data.rel.local+0x80): first defined here
> /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.4/../../../../x86_64-pc-linux-gnu/b
> in/ld: Warning: size of symbol `arginfo_construct' changed from 160 in
> .libs/a.o to 80 in .libs/b.o
>
>
> But in my OS no linker warning presented. Do you know how can I see these warnings in my OS?
>
> Regard
>
> M. Kubelik
>
>
>
> --
> PECL development discussion Mailing List (http://pecl.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>