This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] Support DEC-C extensions
- From: Pedro Alves <pedro at codesourcery dot com>
- To: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Cc: gcc-patches at gcc dot gnu dot org, "Joseph S. Myers" <joseph at codesourcery dot com>, Douglas Rupp <rupp at gnat dot com>, Tristan Gingold <gingold at adacore dot com>
- Date: Tue, 4 Oct 2011 11:46:38 +0100
- Subject: Re: [Patch] Support DEC-C extensions
- References: <51227D85-9E15-48AB-9381-14B597C1F80B@adacore.com> <201110041059.20388.pedro@codesourcery.com> <CAAiZkiCr8VrnO52wzj=WD+OEcMXJPpmOpoxDcTJ=MFenPBtXdw@mail.gmail.com>
On Tuesday 04 October 2011 11:16:30, Gabriel Dos Reis wrote:
> > Do we need to consider ABIs that have calling conventions that
> > treat unprototyped and varargs functions differently? (is there any?)
>
> Could you elaborate on the equivalence of these declarations?
I expected that with:
extern void foo();
extern void bar(...);
foo (1, 2, 0.3f, NULL, 5);
bar (1, 2, 0.3f, NULL, 5);
the compiler would emit the same for both of those
calls (calling convention wise). That is, for example,
on x86-64, %rax is set to 1 (number of floating point
parameters passed to the function in SSE registers) in
both cases.
But not to be equivalent at the source level, that is:
extern void foo();
extern void foo(int a);
extern void bar(...);
extern void bar(int a);
should be a "conflicting types for âbarâ" error in C.
--
Pedro Alves