This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: (fixed) Gcc PPC header file problem


On Wed, 21 Jun 2000, John wrote:
> Hello!
>
> 	I am writing to report what I believe is a bug in the recent Gcc
> distribution.
>
> 	I am running gcc 2.95.2 1991024 (release/franzo) on a G4 power pc
> platform.  This machine is running PPC Linux/2000.
>
> 	I was building ssh-2.1.0 when I encountered a compile-time error
> saying a macro was missing.  I tracked it down to the file 'va-ppc.h'
> which was located in:
> /usr/lib/gcc-lib/ppc-redhat-linux/2.95.2/include/va-ppc.h
>
> 	The error was triggered by the file:
> ssh-secure-shell-2.1.0-noncommercial/lib/sshcrypt/genpkcs.c
> 	This piece of source code handles all the vararg stuff for ssh.
>
> 	I apologize for not submitting my change in a patch form -- I
> modified my original va-ppc.h file and didn't save a backup.  The
> offending entry is on line 102.  Here's my new version from line 99 to
> line 106.  My only change was to copy the va_arg define from the
> non-optimized case to the optimized one.  The original, unedited line is
> prefixed with a double-slash:
>
>    avoid calling it for now.  */
>
> #ifdef __OPTIMIZE__
> // extern void __va_arg_type_violation(void) __attribute__((__noreturn__));
> #define __va_arg_type_violation()
> #else
> #define __va_arg_type_violation()
> #endif
>
> 	The ssh code was being compiled with '-O3', so I'm sure that the
> 'extern void' line was the problem.  I replaced it with a copy of the
> #define for the non-optimized case, and everything works perfectly fine.

This is wrong. Not GCC is buggy, ssh contains illegal C code, probably they 
use something like va_arg(ap,char). You can only pass promoted types thru 
varargs, so this has to be rewritten as (char)va_arg(ap,int).

Franz.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]