Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Paul_Koning@Dell.com, howarth.mailing.lists@gmail.com
Cc: gdb@sourceware.org
Subject: Re: many unused function warnings in gdb 7.9 on darwin
Date: Fri, 27 Feb 2015 09:13:00 -0000	[thread overview]
Message-ID: <54EF8050.3010302@redhat.com> (raw)
In-Reply-To: <024299DE-C682-4DB4-B1A1-FCF89C969C27@dell.com>

On 02/26/2015 07:55 PM, Paul_Koning@Dell.com wrote:
> 
>> On Feb 26, 2015, at 2:41 PM, Jack Howarth <howarth.mailing.lists@gmail.com> wrote:
>>
>> The clang developers have comments on this issue in
>> http://llvm.org/bugs/show_bug.cgi?id=22712#c1. They ask (as I did
>> originally) why we aren't wrapping these functions to keep them from
>> being declared on darwin if they aren't used.
> 
> I can think of a good reason: they are used as cleaner replacements for macros, defined in header files.  So they are used in some files that include those headers, but not others.  That’s why GCC has that rule about not warning if the function is static inline.

Right.  In this case the functions are a result of preprocessor magic
that implements a templated vector type and its methods, in C.  See it here:

 https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/common/vec.h;h=41e41b5b22c9f5ec14711aac35ce4ae6bceab1e7;hb=HEAD

Now, the macros that define the static inline functions _are_ defined
in a header, but then those get expanded in the main source file,
resulting in static inline functions defined in the main source file.
I'm guessing that clang's rule of "header vs main source" is
missing that...

Thanks,
Pedro Alves


      reply	other threads:[~2015-02-26 20:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24 16:33 Jack Howarth
2015-02-26 16:48 ` Pedro Alves
2015-02-26 17:03   ` Jack Howarth
2015-02-26 19:59     ` Jack Howarth
2015-02-26 20:21       ` Paul_Koning
2015-02-27  9:13         ` Pedro Alves [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54EF8050.3010302@redhat.com \
    --to=palves@redhat.com \
    --cc=Paul_Koning@Dell.com \
    --cc=gdb@sourceware.org \
    --cc=howarth.mailing.lists@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox