[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

procps failed with error: redeclaration of enumerator ‘P_PID’



Hi all,

I came across following error.
In file included from top.c:56:0:
top.h:248:4: error: redeclaration of enumerator ‘P_PID’
    P_PID, P_PPD, P_URR, P_UID, P_URE, P_GRP, P_TTY,
    ^

I am using debian 8.
I need help to resolve this issue.


$ tar xvf procps-3.2.7.tar.gz
$ cd procps-3.2.7/
$ make
cc -D_GNU_SOURCE -I proc -I/usr/include/ncurses -MM -MG proc/pwcache.c proc/sig.c proc/alloc.c proc/escape.c proc/version.c proc/slab.c proc/ksym.c proc/sysinfo.c proc/whattime.c proc/devname.c proc/readproc.c > proc/.depend
cc -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions -c -o uptime.o uptime.c
cc -c -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions -DSHARED=1 -fpic proc/pwcache.c -o proc/pwcache.o
cc -c -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions -DSHARED=1 -fpic proc/sig.c -o proc/sig.o
cc -c -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions -DSHARED=1 -fpic proc/alloc.c -o proc/alloc.o
cc -c -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions -DSHARED=1 -fpic proc/escape.c -o proc/escape.o
In file included from proc/escape.h:7:0,
                 from proc/escape.c:15:
proc/readproc.h:76:2: warning: padding struct to align ‘start_code’ [-Wpadded]
  start_code, // stat            address of beginning of code segment
  ^
proc/escape.c: In function ‘escape_command’:
proc/escape.c:184:23: warning: to be safe all intermediate pointers in cast from ‘char ** const’ to ‘const char **’ must be ‘const’ qualified [-Wcast-qual]
     const char **lc = (const char**)pp->cmdline;
                       ^
cc -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions -DSHARED=1 -fpic -DVERSION=\"3\" -DSUBVERSION=\"2\" -DMINORVERSION=\"7\" -c -o proc/version.o proc/version.c
cc -c -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions -DSHARED=1 -fpic proc/slab.c -o proc/slab.o
proc/slab.c:99:1: warning: multi-line comment [-Wcomment]
 //  # name            <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> \
 ^
proc/slab.c:104:1: warning: multi-line comment [-Wcomment]
 //  # name            <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> \
 ^
proc/slab.c:111:1: warning: multi-line comment [-Wcomment]
 //  # name            <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> \
 ^
proc/slab.c:116:1: warning: multi-line comment [-Wcomment]
 //  # name            <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> \
 ^
cc -c -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions -DSHARED=1 -fpic proc/ksym.c -o proc/ksym.o
cc -c -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions -DSHARED=1 -fpic proc/sysinfo.c -o proc/sysinfo.o
cc -c -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions -DSHARED=1 -fpic proc/whattime.c -o proc/whattime.o
cc -c -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions -DSHARED=1 -fpic proc/devname.c -o proc/devname.o
proc/devname.c:52:1: warning: padding struct size to alignment boundary [-Wpadded]
 } tty_map_node;
 ^
cc -c -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions -DSHARED=1 -fpic proc/readproc.c -o proc/readproc.o
In file included from proc/readproc.c:13:0:
proc/readproc.h:76:2: warning: padding struct to align ‘start_code’ [-Wpadded]
  start_code, // stat            address of beginning of code segment
  ^
proc/readproc.c: In function ‘status2proc’:
proc/readproc.c:176:9: warning: array subscript has type ‘char’ [-Wchar-subscripts]
         entry = table[63 & (asso[S[3]] + asso[S[2]] + asso[S[0]])];
         ^
proc/readproc.c:176:9: warning: array subscript has type ‘char’ [-Wchar-subscripts]
proc/readproc.c:176:9: warning: array subscript has type ‘char’ [-Wchar-subscripts]
proc/readproc.c: In function ‘stat2proc’:
proc/readproc.c:391:5: warning: use of assignment suppression and length modifier together in gnu_scanf format [-Wformat=]
     );
     ^
proc/readproc.c:391:5: warning: use of assignment suppression and length modifier together in gnu_scanf format [-Wformat=]
proc/readproc.c: In function ‘statm2proc’:
proc/readproc.c:403:9: warning: variable ‘num’ set but not used [-Wunused-but-set-variable]
     int num;
         ^
proc/readproc.c: At top level:
proc/readproc.c:41:27: warning: ‘unhex’ defined but not used [-Wunused-function]
 static unsigned long long unhex(const char *restrict cp){
                           ^
cc -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions -Wl,-warn-common  -shared -Wl,-soname,libproc-3.2.7.so -Wl,--version-script=proc/library.map -o proc/libproc-3.2.7.so proc/pwcache.o proc/sig.o proc/alloc.o proc/escape.o proc/version.o proc/slab.o proc/ksym.o proc/sysinfo.o proc/whattime.o proc/devname.o proc/readproc.o -lc
cc -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions uptime.o proc/libproc-3.2.7.so -Wl,-warn-common  -o uptime
cc -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions -c -o tload.o tload.c
tload.c:33:12: warning: redundant redeclaration of ‘optind’ [-Wredundant-decls]
 extern int optind;
            ^
In file included from /usr/include/unistd.h:871:0,
                 from tload.c:19:
/usr/include/getopt.h:71:12: note: previous declaration of ‘optind’ was here
 extern int optind;
            ^
tload.c:34:14: warning: redundant redeclaration of ‘optarg’ [-Wredundant-decls]
 extern char *optarg;
              ^
In file included from /usr/include/unistd.h:871:0,
                 from tload.c:19:
/usr/include/getopt.h:57:14: note: previous declaration of ‘optarg’ was here
 extern char *optarg;
              ^
cc -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions tload.o proc/libproc-3.2.7.so -Wl,-warn-common  -o tload
cc -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions -c -o free.o free.c
cc -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions free.o proc/libproc-3.2.7.so -Wl,-warn-common  -o free
cc -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions  -c w.c
In file included from w.c:10:0:
proc/readproc.h:76:2: warning: padding struct to align ‘start_code’ [-Wpadded]
  start_code, // stat            address of beginning of code segment
  ^
w.c: In function ‘getproc’:
w.c:161:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if(!ignoreuser && uid != tmp->euid && uid != tmp->ruid) continue;
                        ^
w.c:161:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if(!ignoreuser && uid != tmp->euid && uid != tmp->ruid) continue;
                                            ^
cc -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions w.o proc/libproc-3.2.7.so -Wl,-warn-common  -o w
cc -D_GNU_SOURCE -I proc -I/usr/include/ncurses -fno-common -ffast-math -W -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -O2 -s  -Wdeclaration-after-statement -Wpadded -Wstrict-aliasing -fweb -frename-registers -fomit-frame-pointer -fno-inline-functions -c -o top.o top.c
In file included from top.c:49:0:
proc/readproc.h:76:2: warning: padding struct to align ‘start_code’ [-Wpadded]
  start_code, // stat            address of beginning of code segment
  ^
In file included from top.c:56:0:
top.h:248:4: error: redeclaration of enumerator ‘P_PID’
    P_PID, P_PPD, P_URR, P_UID, P_URE, P_GRP, P_TTY,
    ^
In file included from /usr/include/stdlib.h:41:0,
                 from top.c:34:
/usr/include/i386-linux-gnu/bits/waitflags.h:53:3: note: previous definition of ‘P_PID’ was here
   P_PID,  /* Wait for specified process.  */
   ^
In file included from top.c:56:0:
top.h:342:1: warning: padding struct size to alignment boundary [-Wpadded]
 } WIN_t;
 ^
top.c: In function ‘capsmk’:
top.c:486:30: warning: value computed is not used [-Wunused-value]
 #define CAPCOPY(dst,src) src && strcpy(dst,src)
                              ^
top.c:503:7: note: in expansion of macro ‘CAPCOPY’
       CAPCOPY(Cap_clr_eol, clr_eol);
       ^
top.c:486:30: warning: value computed is not used [-Wunused-value]
 #define CAPCOPY(dst,src) src && strcpy(dst,src)
                              ^
top.c:504:7: note: in expansion of macro ‘CAPCOPY’
       CAPCOPY(Cap_clr_eos, clr_eos);
       ^
top.c:486:30: warning: value computed is not used [-Wunused-value]
 #define CAPCOPY(dst,src) src && strcpy(dst,src)
                              ^
top.c:505:7: note: in expansion of macro ‘CAPCOPY’
       CAPCOPY(Cap_clr_scr, clear_screen);
       ^
top.c:486:30: warning: value computed is not used [-Wunused-value]
 #define CAPCOPY(dst,src) src && strcpy(dst,src)
                              ^
top.c:508:10: note: in expansion of macro ‘CAPCOPY’
          CAPCOPY(Cap_rmam, exit_am_mode);
          ^
top.c:486:30: warning: value computed is not used [-Wunused-value]
 #define CAPCOPY(dst,src) src && strcpy(dst,src)
                              ^
top.c:509:10: note: in expansion of macro ‘CAPCOPY’
          CAPCOPY(Cap_smam, enter_am_mode);
          ^
top.c:486:30: warning: value computed is not used [-Wunused-value]
 #define CAPCOPY(dst,src) src && strcpy(dst,src)
                              ^
top.c:519:7: note: in expansion of macro ‘CAPCOPY’
       CAPCOPY(Cap_curs_huge, cursor_visible);
       ^
top.c:486:30: warning: value computed is not used [-Wunused-value]
 #define CAPCOPY(dst,src) src && strcpy(dst,src)
                              ^
top.c:520:7: note: in expansion of macro ‘CAPCOPY’
       CAPCOPY(Cap_curs_norm, cursor_normal);
       ^
top.c:486:30: warning: value computed is not used [-Wunused-value]
 #define CAPCOPY(dst,src) src && strcpy(dst,src)
                              ^
top.c:521:7: note: in expansion of macro ‘CAPCOPY’
       CAPCOPY(Cap_home, cursor_home);
       ^
top.c:486:30: warning: value computed is not used [-Wunused-value]
 #define CAPCOPY(dst,src) src && strcpy(dst,src)
                              ^
top.c:522:7: note: in expansion of macro ‘CAPCOPY’
       CAPCOPY(Cap_norm, exit_attribute_mode);
       ^
top.c:486:30: warning: value computed is not used [-Wunused-value]
 #define CAPCOPY(dst,src) src && strcpy(dst,src)
                              ^
top.c:523:7: note: in expansion of macro ‘CAPCOPY’
       CAPCOPY(Cap_reverse, enter_reverse_mode);
       ^
In file included from top.c:56:0:
top.c: In function ‘show_special’:
top.h:156:15: warning: assignment discards ‘const’ qualifier from pointer target type
          _ptr = "\n";                       \
               ^
top.c:682:12: note: in expansion of macro ‘PUFF’
       else PUFF("%s%s\n", row, Cap_clr_eol);
            ^
top.c: In function ‘good_uid’:
top.c:845:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (pp->ruid == selection_uid) return 1;
                    ^
top.c:846:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (pp->suid == selection_uid) return 1;
                    ^
top.c:847:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (pp->fuid == selection_uid) return 1;
                    ^
top.c:850:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (pp->euid == selection_uid) return 1;
                    ^
top.c: In function ‘prochlp’:
top.c:1066:56: warning: passing argument 5 of ‘bsearch’ from incompatible pointer type
    ptr = bsearch(&tmp, hist_sav, maxt_sav, sizeof tmp, sort_HST_t);
                                                        ^
In file included from /usr/include/stdlib.h:760:0,
                 from top.c:34:
/usr/include/i386-linux-gnu/bits/stdlib-bsearch.h:20:1: note: expected ‘__compar_fn_t’ but argument is of type ‘int (*)(const struct HST_t *, const struct HST_t *)’
 bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,
 ^
top.c: In function ‘summary_show’:
top.c:2950:35: warning: passing argument 5 of ‘select’ discards ‘volatile’ qualifier from pointer target type
       select(0, NULL, NULL, NULL, &tv);  // ought to loop until done
                                   ^
In file included from /usr/include/i386-linux-gnu/sys/time.h:29:0,
                 from top.c:24:
/usr/include/i386-linux-gnu/sys/select.h:106:12: note: expected ‘struct timeval * __restrict__’ but argument is of type ‘volatile struct timeval *’
 extern int select (int __nfds, fd_set *__restrict __readfds,
            ^
In file included from top.c:56:0:
top.c: In function ‘task_show’:
top.h:156:15: warning: assignment discards ‘const’ qualifier from pointer target type
          _ptr = "\n";                       \
               ^
top.c:3170:4: note: in expansion of macro ‘PUFF’
    PUFF(
    ^
top.c: In function ‘window_show’:
top.h:156:15: warning: assignment discards ‘const’ qualifier from pointer target type
          _ptr = "\n";                       \
               ^
top.c:3196:4: note: in expansion of macro ‘PUFF’
    PUFF("\n%s%s%s%s", q->capclr_hdr, q->columnhdr, Caps_off, Cap_clr_eol);
    ^
top.c: In function ‘main’:
top.c:3370:38: warning: passing argument 5 of ‘select’ discards ‘volatile’ qualifier from pointer target type
          select(0, NULL, NULL, NULL, &tv);  // ought to loop until done
                                      ^
In file included from /usr/include/i386-linux-gnu/sys/time.h:29:0,
                 from top.c:24:
/usr/include/i386-linux-gnu/sys/select.h:106:12: note: expected ‘struct timeval * __restrict__’ but argument is of type ‘volatile struct timeval *’
 extern int select (int __nfds, fd_set *__restrict __readfds,
            ^
top.c:3389:40: warning: passing argument 5 of ‘select’ discards ‘volatile’ qualifier from pointer target type
             select(1, &fs, NULL, NULL, &tv);
                                        ^
In file included from /usr/include/i386-linux-gnu/sys/time.h:29:0,
                 from top.c:24:
/usr/include/i386-linux-gnu/sys/select.h:106:12: note: expected ‘struct timeval * __restrict__’ but argument is of type ‘volatile struct timeval *’
 extern int select (int __nfds, fd_set *__restrict __readfds,
            ^
Makefile:239: recipe for target 'top.o' failed
make: *** [top.o] Error 1


Also i found following link but the patch attached is broken and not downloading:
http://www.freelists.org/post/procps/top-wont-compile-anymore


Regards,
Dhiraj

Reply to: