[comp.sys.atari.st] Sozobon C C

wilker@batcomputer.tn.cornell.edu (Clarence W. Wilkerson Jr.) (02/01/89)

<line eater bug>
<line eater >
<line eater>
I recently unloaded Sozobon C sources from the net. I'm trying
to get them to work as cross compilers in a couple of environments.
1) Turbo C on an AT
2) gcc 1.26 on a vax and Sun 3.xx 3.5OS
I had to make a few changes to the NODE structure definition on the
Turbo C version and vax version to produce correct code. Presumably
this was some hidden byte order problem. The Sun version seemed to
work right away. I'm left with the following problems:
1) No version will self compile without errors: The message
is usually "Weird ......."
2) The PC version hangs forever in the routine "gunk1" and gunk,
seemingly cycling through the same attempts. Replacing this
with a return makes it work most of the time.
There were a few gotchas  : gcc did not like the "inline"
function. I just renamed it to INLINE.

<line eater>
<line eater>

n62@nikhefh.hep.nl (Klamer Schutte) (02/03/89)

In article <7302@batcomputer.tn.cornell.edu> wilker@batcomputer.tn.cornell.edu (Clarence W. Wilkerson Jr.) writes:
>I recently unloaded Sozobon C sources from the net. I'm trying
>to get them to work as cross compilers in a couple of environments.
so have i, on a sun.
>1) No version will self compile without errors: The message
>is usually "Weird ......."

I did not get such a kind of error, the only change i had to make was to make 
the program believe the compiler ( (i think normal) cc on sun/3 ) did not 
support enum; Where is the bug? I never have used enum. Please somebody answer.
-- 
________________________________________________________________________________
Klamer Schutte			mcvax!nikhefh!n62	      n62@nikhefh.hep.nl

lee@uhccux.uhcc.hawaii.edu (Greg Lee) (02/06/89)

From article <608@nikhefh.hep.nl>, by n62@nikhefh.hep.nl (Klamer Schutte):
"In article <7302@batcomputer.tn.cornell.edu> wilker@batcomputer.tn.cornell.edu (Clarence W. Wilkerson Jr.) writes:
">I recently unloaded Sozobon C sources from the net. I'm trying
">to get them to work as cross compilers in a couple of environments.
"so have i, on a sun.
">1) No version will self compile without errors: The message
">is usually "Weird ......."
"
"I did not get such a kind of error, the only change i had to make was to make 
"the program believe the compiler ( (i think normal) cc on sun/3 ) did not 
"support enum; Where is the bug? I never have used enum. Please somebody answer.

I'm trying to get it to work on Ultrix 2.2.  pcc will not accept the
code with ENUMS defined, but it will without.  gcc (v. 1.31) will
compile it with ENUMS defined.  However with both I encounter a
bug involving bit-fields.  Maybe someone has a suggestion.  The
code generation routines in gen.c get the idea that stuff inside
a struct is a bit-field with field-width (g_fldw) equal to the
entire size of the struct.  Even though no bit fields have been
declared.  The consequence is that code for accessing a bit-field
is generated, and ultimately an error.

The following causes the error (with the declarations of node.h):

char *xxx;
NODE *tp;
	xxx = tp->e_name;

The error can be prevented by commenting out the following lines
in routine 'u_sube' (file 'gen.c'):

		if (np->g_fldw)
			return fldget(np, flags);

but then the correct code for bit-fields is not generated.

		Greg, lee@uhccux.uhcc.hawaii.edu