Message-ID: <0ab801c306bf$4dacb430$0600000a@broadpark.no> From: "Gisle Vanem" To: "djgpp" Subject: __builtin_va_list bug? Date: Sun, 20 Apr 2003 00:02:00 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1123 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1123 Reply-To: djgpp AT delorie DOT com I'm porting some code from Watcom to gcc/djgpp and encountered tons of warnings on illegal use of va_arg(). So I cooked up a little test: #include char x; void foo (va_list arg) { x = va_arg (arg, char); } This gives a warning "`char' is promoted to `int' when passed through `...'" Fair enough, but when I produce an asm-listing, here's what I get: .file "test.c" .section .text .globl _foo _foo: pushl %ebp movl %esp, %ebp int $5 .comm _x,16 .ident "GCC: (GNU) 3.2.2" What's the "int $5" doing there? Is this a gcc bug or feature? If so, is there a fix? Using "va_arg (arg,int)" produces the correct code. As you see, I'm using gcc 3.2.2. --gv