Skip to content

error: implicit declaration of function ‘major’ #4

@birdie-github

Description

@birdie-github

Under Fedora 35:

cc -O2 -g -Wall -Wextra -Werror   -c -o fanotify_watch.o fanotify_watch.c
fanotify_watch.c: In function ‘print_event’:
fanotify_watch.c:124:19: error: implicit declaration of function ‘major’ [-Werror=implicit-function-declaration]
  124 |                   major (st.st_dev), minor (st.st_dev), st.st_ino);
      |                   ^~~~~
fanotify_watch.c:124:38: error: implicit declaration of function ‘minor’ [-Werror=implicit-function-declaration]
  124 |                   major (st.st_dev), minor (st.st_dev), st.st_ino);
      |                                      ^~~~~
cc1: all warnings being treated as errors
make: *** [<builtin>: fanotify_watch.o] Error 1

This could be fixed by

#include <sys/sysmacros.h>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions