Re: [cc65] snapshot

Date view Thread view Subject view

From: Groepaz (groepaz_at_gmx.net)
Date: 2003-08-30 00:41:55


On Friday 29 August 2003 11:41, Ullrich von Bassewitz wrote:
> > f(i)
> > {
> > 	i=f()+f();
> > }
>
> [...]
>
> > int test(char *s);
> >
> > test(*s)
> > char *s;
> > {
> > }
>
> While those could be fixed, I don't think it's a good idea, because both
> examples show problematic uses, were the source code should get changed,
> not the compiler. Old style function decls are deprecated in C99 and will
> be removed with the next version of the standard, so my stand is to fix
> important things, not obscure features.
>
> In case of the former, I would even say, the code violates the C99 standard
> which says in 6.9.1.8:
>
>     If a function that accepts a variable number of arguments is defined
>     without a parameter type list that ends with the ellipsis notation, the
>     behavior is undefined.
>
> (but then, C99 does also remove "implicit int", so both function decls
> would be invalid according to the new standard).

ok ok, so i'll just comment them out in the test or sth :o)

> > the tests that compile still dont work due to some appearent problem in
> > the posix directory and/or cbm file i/o stuff.... mpf
>
> If you can give me a few more hints, or a short piece of non working code,
> I will try to fix it.

havent tracked that down yet, sorry...

> > - functions that return structs seem to translate correctly now (i had to
> > disable this before)

this was supposed to mean "function that get structs as parameters"...there 
were some hickups at some places before which are now gone it seems

> C functions still cannot return structs, but assembler functions can if the
> size of the struct is one of 1, 2 or 4 (it is returned in the primary
> register).
>
> > - even enabling "functions can return structs" doesnt result in an error
> > (?!?) does that really have been fixed or is that testsuite playing
> > tricks on me?
>
> The compiler is supposed to issue an error if a C function tries to return
> a structure. My own tests show that this is the case, but maybe that the
> test suite is somewhat more creative. Can you send me the code that returns
> a structure which is accepted by the compiler?

i have to re-check that.... i just removed a related define and to be honest, 
i am not sure if i didnt previously remove the struct stuff alltogether in 
the code :=P gotta have a look :)

> > - several small problems with initializing structs and/or using curly
> > braces in a "creative" way seem to be gone
>
> At least there is progress in a few areas :-)
>
> Thanks for doing all the tests!
>
> Regards
>
>
>         Uz

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-08-30 00:46:21 CEST