[cfe-users] -Wunused-local-typedef

Barnes, Peter D. barnes26 at llnl.gov
Wed Jul 22 12:02:23 PDT 2015

Hello Folks,

We’ve run in to a Clang warning very similar to what was fixed in r221765, with clang reporting an unused typedef:

    typedef void (*FUNCTION)(void);
    void foo (FUNCTION f);

The typedef is obviously used, but get’s reported as:

>> $ clang --version
>> Debian clang version 3.6.2-+rc1-1~exp1 (tags/RELEASE_362/rc1) (based on
>> LLVM 3.6.2)
>> Target: x86_64-pc-linux-gnu
>> Thread model: posix
>> ...
>> ...

>> ./ns3/make-event.h:605:20: error: unused typedef 'F'
>> [-Werror,-Wunused-local-typedef]
>>     typedef void (*F)(U1, U2, U3, U4);
>>                    ^
>> 1 error generated.

You can browse source of this specific error instance here:

Can you confirm that this is a clang bug?  Or our misunderstanding?

I haven’t found anything relevant on the tracker...

Dr. Peter D. Barnes, Jr.                Physics Division
Lawrence Livermore National Laboratory  Physical and Life Sciences
7000 East Avenue, L-50                  email:  pdbarnes at llnl.gov
P. O. Box 808                           Voice:  (925) 422-3384
Livermore, California 94550             Fax:    (925) 423-3371

More information about the cfe-users mailing list