buggperf - Bugs: bug #37071, plain inlines (with external...


bug #37071: plain inlines (with external linkage) cause havoc when mixed with internal linkage inlines

Submitted by:  Sebastian Freundt <hroptatyr>
Submitted on:  Fri 10 Aug 2012 12:50:03 PM UTC  
Votes:  1  
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Wed 24 Dec 2014 04:48:12 AM UTC, comment #1:

Well, the main question is why it was made with internal linkage in first place. If it's just a link-time optimization then it can be safely thrown away. Also, in order for lookup function to have the same linkage as hashing one
should be added to attributes. In this way not only the original bug is fixed, but related compilation problem is resolved as well.

Sergii Strelkovskyi <loozer>
Fri 10 Aug 2012 12:50:03 PM UTC, original submission:

The emitted code

#ifdef _GNUC_
#ifdef __cplusplus
static unsigned int
__tid_hash (register const char *str, register unsigned int len)

has internal linkage (as per the static keyword).

In contrast, a few lines down the road:

#ifdef _GNUC_
#if defined _GNUC_STDC_INLINE_ || defined _GNUC_GNU_INLINE_
_attribute_ ((_gnu_inline_))
const struct tws_xml_tag_s *
__tiddify (register const char *str, register unsigned int len)
register int key = __tid_hash (str, len);

there's a reference from a function with external linkage (as per the plain inline) to a function with internal linkage.

This results in a warning:

../../src/proto-twsxml-tag.gperf(28): warning #1173: an entity with internal linkage cannot be referenced within an inline function with external linkage

Suggested fix:
Both functions (maybe optionally) should have internal linkage.

Sebastian Freundt <hroptatyr>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by loozer (Voted in favor of this item)
  • -unavailable- added by loozer (Posted a comment)
  • -unavailable- added by hroptatyr (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 1 encouragement so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 24 Dec 2014 04:49:46 AM UTCloozerCarbon-Copy-=>Added loozer

    Back to the top

    Powered by Savane 3.1-cleanup