This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
RE: AW: Renesas __trap34() system calls broken - possibly on other platforms, too
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: "'Jonas Mark \(ST-FIR/ENG1\)'" <Mark dot Jonas at de dot bosch dot com>, "'Andrew STUBBS'" <andrew dot stubbs at st dot com>, <newlib at sourceware dot org>
- Date: Wed, 10 Jan 2007 16:31:25 -0000
- Subject: RE: AW: Renesas __trap34() system calls broken - possibly on other platforms, too
On 10 January 2007 16:13, Jonas Mark (ST-FIR/ENG1) wrote:
[ Re: posix style paths: Doh, I've gone and mixed up mingw and msys. Msys
understands paths like /c/tmp/foo.c, i.e. the same as cygwin but without the
/cygdrive prefix. ]
> No, it is not about hand-coded assembler code. The __trap34()
> implementation in trap.S is overwritten during link time by my code.
> syscalls.c is C language and my code is as well (see my first post). My
> code implements the variadic function __trap34(). Because it only has an
> implicit function prototype in syscalls.c the compiler cannot know it is
> variadic and therefore rightly does not produce matching code.
It's undefined behaviour to call an unprototyped variadic function. Fix
that and your problem should be solved.
>>> I do not think gcc is broken. How should the compiler know when to
>>> put all parameters on the stack because it is a variable argument
>>> list function?
The prototype tells the compiler where to put the args. That's why it's
undefined if you attempt to call it in the absence of a prototype.
cheers,
DaveK
--
Can't think of a witty .sigline today....