回复: function symbol surroun d by ifndef else endif will no t be find by gnu global

"weidong" <[email protected]> Mon, 25 Oct 2021 16:34:06 +0800
Newsgroups gmane.comp.gnu.global.bugs
Message-ID <[email protected]>
Hello,
I hope this bug can be fixed, My job is code analysis I can not change the source code.


------------------&nbsp;原始邮件&nbsp;------------------
发件人:                                                                                                                        "Shigio YAMAGUCHI"                                                                                    <[email protected]&gt;;
发送时间:&nbsp;2021年10月22日(星期五) 上午10:17
收件人:&nbsp;"weidong"<[email protected]&gt;;
抄送:&nbsp;"bug-global"<[email protected]&gt;;
主题:&nbsp;Re: function symbol surround by ifndef else endif will not be find by gnu global



Hello,
&gt; the attached file is test.c which expose&nbsp; the bug
&gt; I can not find the symbol testfun when use the latest version of gnu global6.6.7

It is a bug.
The current parser cannot recognize the split function definition.
I will this bug to the bugs list.

Here is a workaround. It works correctly with the following changes:

[current]
#ifndef _SOMETAG
static inline int testfun
#else
static int testfun
#endif
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )
|
v
[changed]
#ifndef _SOMETAG
static inline int testfun
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )
#else
static int testfun
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )
#endif

Thank you for the report.

Regards,
Shigio
-- 
Shigio YAMAGUCHI <[email protected]&gt;
PGP fingerprint:
26F6 31B4 3D62 4A92 7E6F&nbsp; 1C33 969C 3BE3 89DD A6EB