Re: many unused function warnings in gdb 7.9 on darwin
Pedro Alves <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
On 02/26/2015 07:55 PM, [email protected] wrote: > >> On Feb 26, 2015, at 2:41 PM, Jack Howarth <[email protected]> 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