Portál AbcLinuxu, 1. června 2025 19:08
make test cc -O -c exit.c In file included from exit.c:19: /usr/lib/gcc/i486-linux-gnu/4.1.2/include/va.rargs..h:4:2: error: #error "GCC no longer implements varargs.h." /usr/lib/gcc/i486-linux-gnu/4.1.2/include/v.arargs.h:5:2: error: #error "Revise your code to use stdarg.h." exit.c: In function 'error_exit': exit.c:60: error: expected declaration specifiers before 'va_dcl' exit.c:101: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'va_dcl'Něco dělám špatně, ale nejsem schopen error opravit. Má někdo nějaký nápad, v čem by mohl být problém? gcc, libgcc1 gcc-4.1 a gcc-4.1-base mám nainstalováno.
Hlavne bych rekl, ze chyba je na strane vyvojaru a ne na vasi. Zkuste nainstalovat jeste starsi verzi gcc (nejlip nejakou 3.x verzi) a zkusit ten program zkompilovat s ni.
Mozna ale bude stacit nahradit vsechny vyskyty varargs.h na stdarg.h. Treba takhle:
find . -type f -print0 | xargs -0 sed -i 's/varargs\.h/stdarg\.h/g'
server:/home/dalibor# dpkg -l | grep gcc ii gcc 4.1.1-15 The GNU C compiler ii gcc-3.3-base 3.3.6-15 The GNU Compiler Collection (base package) ii gcc-3.4 3.4.6-5 The GNU C compiler ii gcc-3.4-base 3.4.6-5 The GNU Compiler Collection (base package) ii gcc-4.1 4.1.1-21 The GNU C compiler ii gcc-4.1-base 4.1.1-21 The GNU Compiler Collection (base package) ii libgcc1 4.1.1-21 GCC support libraryV tom případě, jak donutit instalátor, aby vybral verzi 3.4.6? (/usr/lib/gcc/i486-linux-gnu/3.4.6 místo /4.1.2)? Nahrazení varargs.h na stdarg.h nepomohlo.
user@stroj:~$ export MAKEFLAGS="CC=gcc-4.2"Ještě před konfigurací deb balíku.. Ale snad by mělo stačit export CC="gcc-4.2"
ls /usr/bin/gcc*
), vyber si jednu (v Tvém případě asi gcc-3.4) a pak v Makefile uprav na 5. řádku CC = cc
na CC = gcc-3.4
. Snad to bude fungovat.
vim ~/.emacs
vim ~/.emacs
make test gcc-3.4 -O -c exit.c In file included from exit.c:19: /usr/lib/gcc/i486-linux-gnu/3.4.6/include/varargs.h:4:2: #error "GCC no longer implements varargs.h." /usr/lib/gcc/i486-linux-gnu/3.4.6/include/varargs.h:5:2: #error "Revise your code to use stdarg.h." exit.c:60: error: syntax error before "va_dcl" exit.c:60: error: syntax error before '{' token exit.c:64: warning: parameter names (without types) in function declaration exit.c:64: warning: data definition has no type or storage class ..Takže problém bude asi opravdu u vývojářů
make test cc -O -c exit.c In file included from /usr/include/stdio.h:72, from exit.c:8: /usr/include/libio.h:53:21: error: stdarg.h: není souborem ani adresářem In file included from /usr/include/stdio.h:72, from exit.c:8: /usr/include/libio.h:475: error: expected declaration specifiers or '...' before '__gnuc_va_list' /usr/include/libio.h:477: error: expected declaration specifiers or '...' before '__gnuc_va_list' In file included from exit.c:8: /usr/include/stdio.h:337: error: expected declaration specifiers or '...' before '__gnuc_va_list' /usr/include/stdio.h:342: error: expected declaration specifiers or '...' before '__gnuc_va_list' /usr/include/stdio.h:345: error: expected declaration specifiers or '...' before '__gnuc_va_list' /usr/include/stdio.h:356: error: expected declaration specifiers or '...' before '__gnuc_va_list' In file included from /usr/include/stdio.h:828, from exit.c:8: /usr/include/bits/stdio.h:34: error: expected declaration specifiers or '...' before '__gnuc_va_list' /usr/include/bits/stdio.h: In function 'vprintf': /usr/include/bits/stdio.h:36: error: '__arg' undeclared (first use in this function) /usr/include/bits/stdio.h:36: error: (Each undeclared identifier is reported only once /usr/include/bits/stdio.h:36: error: for each function it appears in.) /usr/include/bits/stdio.h:36: error: too many arguments to function 'vfprintf' exit.c: In function 'error_exit': exit.c:60: error: expected declaration specifiers before 'va_dcl' exit.c:101: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'va_dcl' exit.c:143: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'va_dcl' exit.c:184: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'va_dcl' exit.c:215: error: expected '{' at end of input make: *** [exit.o] Error 1
gcc-3.4 -O -c exit.c exit.c:60: error: syntax error before "va_dcl" exit.c:60: error: syntax error before '{' token exit.c:64:16: macro "va_start" requires 2 arguments, but only 1 given exit.c:64: warning: data definition has no type or storage class exit.c:65: error: conflicting types for 'fmt' exit.c:62: error: previous declaration of 'fmt' was here exit.c:65: error: `args' undeclared here (not in a function) exit.c:65: warning: initialization makes integer from pointer without a cast exit.c:65: error: initializer element is not constant exit.c:65: warning: data definition has no type or storage class exit.c:68: error: syntax error before "if" exit.c:82: error: syntax error before string constant exit.c:82: error: conflicting types for 'strcat' ... a dále pokračování obdobně ..
vim ~/.emacs
#ifndef _VARARGS_H #define _VARARGS_H #error "GCC no longer implements varargs.h." #error "Revise your code to use stdarg.h." #endif server:/home/instal/SHNnaWAV/shorten-2.3a# cat varargs.h #ifndef _VARARGS_H #define _VARARGS_H #error "GCC no longer implements varargs.h." #error "Revise your code to use stdarg.h." #endif
make[3]: Nothing to be done for `install-data-am'. make[3]: Leaving directory `/home/instal/SHNnaWAV/shorten-3.6.0/src' make[2]: Leaving directory `/home/instal/SHNnaWAV/shorten-3.6.0/src' make[1]: Leaving directory `/home/instal/SHNnaWAV/shorten-3.6.0/src' Making install in tests make[1]: Entering directory `/home/instal/SHNnaWAV/shorten-3.6.0/tests' make[2]: Entering directory `/home/instal/SHNnaWAV/shorten-3.6.0/tests' make[2]: Nothing to be done for `install-exec-am'. make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/home/instal/SHNnaWAV/shorten-3.6.0/tests' make[1]: Leaving directory `/home/instal/SHNnaWAV/shorten-3.6.0/tests' make[1]: Entering directory `/home/instal/SHNnaWAV/shorten-3.6.0' make[2]: Entering directory `/home/instal/SHNnaWAV/shorten-3.6.0' make[2]: Nothing to be done for `install-exec-am'. make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/home/instal/SHNnaWAV/shorten-3.6.0' make[1]: Leaving directory `/home/instal/SHNnaWAV/shorten-3.6.0'
Co tě vede k názoru, že to jsou chyby? Já v tom výpisu teda žádný nevidim...
/usr/local/bin/shorten
?
shorten: input file is not a valid RIFF WAVE file shorten: for more information use: shorten -hJe někde chyba nebo může jít o poškozené soubory? Dík
Přestaň šašit s verzema GCC a na začátek souboru exit.c
přidej řádek:
#define HAVE_STDARG_H
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.