<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
I've tried to generate "very good C".<br>I've fixed some of what gcc -Wall complains about.<br>For default gcc on my old MacBook -- old enough that it can still emulate PowerPC, gcc is 4.0.1.<br>(at least one of what I deal with, I think anything newer won't complain..)<br><br><br><br>do-cm3-all with -Wall -Werror gets very far, to:<br><br>== package /Users/jay/dev2/cm3/m3-db/stablegen ==<br><br> +++ /cm3/bin/cm3 -build -DROOT=/Users/jay/dev2/cm3 +++<br>--- building in AMD64_DARWIN ---<br><br>ignoring ../src/m3overrides<br><br>w source -> compiling GenCode.m3<br>cc1: warnings being treated as errors<br>GenCode.mc.c: In function ‘GenCode__BuildMethods__Search’:<br>GenCode.mc.c:3505: warning: control reaches end of non-void function<br> m3_backend => 1<br><br> PROCEDURE Search ( type : Type.Reference;<br> VAR count : INTEGER;<br> VAR top : CARDINAL;<br> umethods: AtomList.T ):<br> ImportList.MethodList RAISES {StablegenError.E} =<br> VAR methods: ImportList.MethodList;<br> BEGIN<br> IF (type = Type.root) OR (type = NIL) THEN (* base of<br> recursion *)<br> RETURN NEW(ImportList.MethodList, ABS(count))<br> ELSE<br> TYPECASE type OF<br> Type.Object (ob) => <br> IF count <= 0 THEN<br> count:= count - NUMBER(ob.methods^)<br> END;<br> methods := Search(ob.super, count, top, umethods);<br> FOR i := 0 TO LAST(ob.methods^) DO<br> IF umethods = NIL<br> OR AtomList.Member(<br> umethods, ob.methods[i].name) THEN<br> IF AtomList.Member(reserved, ob.methods[i].name) THEN<br> RAISE StablegenError.E(Atom.ToText(ob.methods[i].name)<br> &" is a reserved method name in stable objects. "<br> &"Must not be an update method.")<br> END;<br> methods[top].name := ob.methods[i].name;<br> methods[top].sig := ob.methods[i].sig;<br> INC(top)<br> END<br> END;<br> RETURN methods<br> | Type.Opaque (op) =><br> RETURN Search(op.revealedSuperType, count, top, umethods)<br> | Type.Reference => <*ASSERT FALSE*><br> END<br> END<br> END Search;<br><br>I think we can't expect gcc -Wall -Werror to pass.<br>I really wanted it to, and I tried, and I fixed stuff.<br>But I don't think it is viable.<br>Ok?<br><br><br> - Jay<br> </div></body>
</html>