[Patch] Support DEC-C extensions

Pedro Alves pedro@codesourcery.com
Tue Oct 4 11:01:00 GMT 2011


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



More information about the Gcc-patches mailing list