This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
va_arg on Alpha Linux
- From: Susukita Ryutaro <susukita at postman dot riken dot go dot jp>
- To: bug-gcc at gnu dot org
- Cc: susukita at postman dot riken dot go dot jp
- Date: Fri, 28 Mar 2003 12:35:35 +0900
- Subject: va_arg on Alpha Linux
I compiled the following program using gcc 3.2.2 on Alpha RedHat 6.1.
#include <stdarg.h>
#include <stdio.h>
struct aaa_t{
int bbb[13];
};
void foo(struct aaa_t c, int n, ...){
va_list va;
double d;
va_start(va, n);
d = va_arg(va, double);
printf("%f\n", d);
}
int main(){
struct aaa_t c;
foo(c, 1, 3.0);
}
$ gcc test_va.c
$ ./a.out
0.000000
Is it a bug?
When I compiled using Compaq C, d is 3.
$ gcc -v
Reading specs from local/bin/../lib/gcc-lib/alphaev67-unknown-linux-gnu/3.2.2/specs
Configured with: ../gcc-3.2.2/configure --prefix=/home/susukita/local
Thread model: posix
gcc version 3.2.2
SUSUKITA, Ryutaro
The Institute of Physical and Chemical Research (RIKEN)
Computational Science Division
To: bug-gcc at gnu dot org
cc: va_arg on Alpha Linux
Subject: susukita
--------
I compiled the following program using gcc 3.2.2 on Alpha RedHat 6.1.
#include <stdarg.h>
#include <stdio.h>
struct aaa_t{
int bbb[13];
};
void foo(struct aaa_t c, int n, ...){
va_list va;
double d;
va_start(va, n);
d = va_arg(va, double);
printf("%f\n", d);
}
int main(){
struct aaa_t c;
foo(c, 1, 3.0);
}
$ gcc test_va.c
$ ./a.out
0.000000
Is it a bug?
When I compiled using Compaq C, d is 3.
$ gcc -v
Reading specs from local/bin/../lib/gcc-lib/alphaev67-unknown-linux-gnu/3.2.2/specs
Configured with: ../gcc-3.2.2/configure --prefix=/home/susukita/local
Thread model: posix
gcc version 3.2.2
SUSUKITA, Ryutaro
The Institute of Physical and Chemical Research (RIKEN)
Computational Science Division