warning: useless type name in empty declaration

10,157

This line is abnormal because you declare a type but no variable name

extern user_identifier;

For example, with ints, you would write

extern int x;

not

  extern int;
Share:
10,157
Aman Deep Gautam
Author by

Aman Deep Gautam

Software developer at Amazon India. Graduated form IIT Hyderabad in 2013 with honors in Computer Science.

Updated on June 04, 2022

Comments

  • Aman Deep Gautam
    Aman Deep Gautam almost 2 years

    I have a project and two files in the project are named as query-structures.h query-structures.c. Contents in the query-structures.h are

    #include <stdint.h>
    typedef struct user_identifier user_identifier;
    extern user_identifier;
    

    and in query-structures.c are

    #include "query-structures.h"
    struct user_identifier
    {
        uint64_t user_id;
    };
    

    Now the Compiler is giving me a warning as

    warning: useless type name in empty declaration [enabled by default]

    I cannot understand why this warning is there because I have to use this struct in other files of my project.