-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ubuntu18.10: linux_sigar.c:1177:22: error: called object ‘major’ is not a function or function pointer #128
Comments
root@kbe-VirtualBox:/home/kbe/sigar# gcc -v |
root@kbe-VirtualBox:/home/kbe/sigar# ldd --version |
i suggest if you add such lines in linux_sigar.c, it should be fixed: #ifdef HAVE_SYS_SYSMACROS_H
#include <sys/sysmacros.h>
#endif |
I've tried that and it still doesn't work. |
i tried this, and it works just add "#include <sys/sysmacros.h>" to linux_sigar.c, not add " #ifdef HAVE_SYS_SYSMACROS_H; #endif" |
|
@GrbavaCigla, i fixed this and other compilation errors, in my fork: https://github.com/kostya/sigar |
@kostya I get the same error: major is not a function or function pointer |
After fixing that I have:
|
major fixed in this commit: kostya@a2c6758, var: LINUX_SYSMACROS added by ruby installer, when you install gem kostya-sigar. For other languages, need some other fixes. |
linux_sigar.c: In function ‘sigar_os_proc_list_get’:
linux_sigar.c:617:5: warning: ‘readdir_r’ is deprecated [-Wdeprecated-declarations]
while (readdir_r(dirp, &dbuf, &ent) == 0) {
^~~~~
In file included from linux_sigar.c:19:
/usr/include/dirent.h:183:12: note: declared here
extern int readdir_r (DIR *__restrict __dirp,
^~~~~~~~~
linux_sigar.c: In function ‘get_iostat_proc_dstat’:
linux_sigar.c:1177:22: warning: implicit declaration of function ‘major’ [-Wimplicit-function-declaration]
#define ST_MAJOR(sb) major((sb).st_rdev)
^~~~~
linux_sigar.c:1253:26: note: in expansion of macro ‘ST_MAJOR’
ST_MAJOR(sb), ST_MINOR(sb));
^~~~~~~~
linux_sigar.c:1178:22: warning: implicit declaration of function ‘minor’; did you mean ‘mknod’? [-Wimplicit-function-declaration]
#define ST_MINOR(sb) minor((sb).st_rdev)
^~~~~
linux_sigar.c:1253:40: note: in expansion of macro ‘ST_MINOR’
ST_MAJOR(sb), ST_MINOR(sb));
^~~~~~~~
linux_sigar.c:1177:22: error: called object ‘major’ is not a function or function pointer
#define ST_MAJOR(sb) major((sb).st_rdev)
^~~~~
linux_sigar.c:1266:23: note: in expansion of macro ‘ST_MAJOR’
if ((major == ST_MAJOR(sb)) &&
^~~~~~~~
linux_sigar.c:1261:23: note: declared here
unsigned long major, minor;
^~~~~
linux_sigar.c:1178:22: error: called object ‘minor’ is not a function or function pointer
#define ST_MINOR(sb) minor((sb).st_rdev)
^~~~~
linux_sigar.c:1267:24: note: in expansion of macro ‘ST_MINOR’
((minor == ST_MINOR(sb)) || (minor == 0)))
^~~~~~~~
linux_sigar.c:1261:30: note: declared here
unsigned long major, minor;
^~~~~
linux_sigar.c:1178:22: error: called object ‘minor’ is not a function or function pointer
#define ST_MINOR(sb) minor((sb).st_rdev)
^~~~~
linux_sigar.c:1318:26: note: in expansion of macro ‘ST_MINOR’
if (minor == ST_MINOR(sb)) {
^~~~~~~~
linux_sigar.c:1261:30: note: declared here
unsigned long major, minor;
^~~~~
linux_sigar.c: In function ‘get_iostat_procp’:
linux_sigar.c:1177:22: error: called object ‘major’ is not a function or function pointer
#define ST_MAJOR(sb) major((sb).st_rdev)
^~~~~
linux_sigar.c:1369:23: note: in expansion of macro ‘ST_MAJOR’
if ((major == ST_MAJOR(sb)) && (minor == ST_MINOR(sb))) {
^~~~~~~~
linux_sigar.c:1364:23: note: declared here
unsigned long major, minor;
^~~~~
linux_sigar.c:1178:22: error: called object ‘minor’ is not a function or function pointer
#define ST_MINOR(sb) minor((sb).st_rdev)
^~~~~
linux_sigar.c:1369:50: note: in expansion of macro ‘ST_MINOR’
if ((major == ST_MAJOR(sb)) && (minor == ST_MINOR(sb))) {
^~~~~~~~
linux_sigar.c:1364:30: note: declared here
unsigned long major, minor;
^~~~~
linux_sigar.c: In function ‘sigar_proc_port_get’:
linux_sigar.c:2505:5: warning: ‘readdir_r’ is deprecated [-Wdeprecated-declarations]
while (readdir_r(dirp, &dbuf, &ent) == 0) {
^~~~~
In file included from linux_sigar.c:19:
/usr/include/dirent.h:183:12: note: declared here
extern int readdir_r (DIR *__restrict __dirp,
^~~~~~~~~
linux_sigar.c:2546:9: warning: ‘readdir_r’ is deprecated [-Wdeprecated-declarations]
while (readdir_r(fd_dirp, &fd_dbuf, &fd_ent) == 0) {
^~~~~
In file included from linux_sigar.c:19:
/usr/include/dirent.h:183:12: note: declared here
extern int readdir_r (DIR *__restrict __dirp,
^~~~~~~~~
In file included from linux_sigar.c:30:
linux_sigar.c: At top level:
../../../include/sigar_util.h:82:20: warning: inline function ‘sigar_skip_multiple_token’ declared but never defined
SIGAR_INLINE char *sigar_skip_multiple_token(char *p, int count);
^~~~~~~~~~~~~~~~~~~~~~~~~
../../../include/sigar_util.h:80:20: warning: inline function ‘sigar_skip_token’ declared but never defined
SIGAR_INLINE char *sigar_skip_token(char *p);
^~~~~~~~~~~~~~~~
../../../include/sigar_util.h:78:20: warning: inline function ‘sigar_skip_line’ declared but never defined
SIGAR_INLINE char *sigar_skip_line(char buffer, int buflen); ^~~~~~~~~~~~~~~ linux_sigar.c: In function ‘sigar_cpu_list_get’: linux_sigar.c:453:11: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] (void)fgets(cpu_total, sizeof(cpu_total), fp); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ linux_sigar.c: In function ‘get_iostat_procp’: linux_sigar.c:1362:11: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] (void)fgets(buffer, sizeof(buffer), fp); / skip header / ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ linux_sigar.c: In function ‘sigar_net_route_list_get’: linux_sigar.c:1734:11: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] (void)fgets(buffer, sizeof(buffer), fp); / skip header / ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ linux_sigar.c: In function ‘sigar_net_interface_stat_get’: linux_sigar.c:1777:5: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] fgets(buffer, sizeof(buffer), fp); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ linux_sigar.c:1778:5: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] fgets(buffer, sizeof(buffer), fp); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ linux_sigar.c: In function ‘proc_net_read’: linux_sigar.c:1942:5: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] fgets(buffer, sizeof(buffer), fp); / skip header / ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ linux_sigar.c: In function ‘sigar_arp_list_get’: linux_sigar.c:2423:11: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] (void)fgets(buffer, sizeof(buffer), fp); / skip header */
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[3]: *** [Makefile:396: linux_sigar.lo] Error 1
make[3]: Leaving directory '/home/kbe/sigar/src/os/linux'
make[2]: *** [Makefile:368: all-recursive] Error 1
make[2]: Leaving directory '/home/kbe/sigar/src/os'
make[1]: *** [Makefile:604: all-recursive] Error 1
make[1]: Leaving directory '/home/kbe/sigar/src'
make: *** [Makefile:392: all-recursive] Error 1
root@kbe-VirtualBox:/home/kbe/sigar#
The text was updated successfully, but these errors were encountered: