Re: [cc65] testsuite results ...

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2009-09-07 19:13:56
On Sun, Sep 06, 2009 at 07:19:23PM +0200, Groepaz wrote:
> > fields.c does not run, because currently structs containing bit-fields
> > cannot be initialized statically. I simply forgot to implement it, when
> > adding bit-fields.
>
> ah ok :)

fields.c should now work but there are still differences between gcc and cc65
output. This is because ISO/IEC 9899:1999 (E) says in 6.7.2.1 "Structure and
union specifiers", footnote 104:

  "As specified in 6.7.2 above, if the actual type specifier used is int or a
  typedef-name defined as int, then it is implementation-defined whether the
  bit-field is signed or unsigned."

gcc chooses signed bit-fields, while cc65 implements unsigned bit-fields for
obvious reasons. This causes a difference in two numbers of the output. If you
want the same output, you may change the code to declare the bit-fields as
unsigned (instead of int).

> > I had already a look at yacc.c, but for the test, the input file yacc.in is
> > missing, so I cannot run it here. So I hoped this was fixed when I fixed
> > the other errors, which was seemingly wrong. Can you send me the file in
> > private mail or point me to a download link?
>
> the input file contains a single line: (i'll add links to them on the report
> pages... :))

I still cannot get it running with the error message in your report. For me,
it just hangs, and the code is somewhat wicked (means: I do not understand
it:-)

> apropos... cc65090726.c contains some passing of struct pointers to functions
> which take a different type - cc65 errors out on them. i have now made it
> skip those 3, i assumed that this behavior (giving an error instead of just a
> warning) is completely "legal" ... am i correct?

The C standard doesn't talk about "errors" and "warnings", all it knows are
"diagnostics". It is up to the compiler writer to specify what is a
"diagnostic". Passing a pointer of the wrong type is in my eyes such a strong
sign for an error in the program, that I decided, not to generate output in
this case. The gcc creators decided that it is worth generating an executable
for reasons unknown to me. Both approaches are correct according to the C
standard, since both compilers output a "diagnostic".

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Sep 7 19:16:21 2009

This archive was generated by hypermail 2.1.8 : 2009-09-07 19:16:24 CEST