Menu

#1 Fix Error in Generate Template Code

closed
nobody
None
5
2009-12-16
2009-12-14
Steve James
No

This patch fixes the generation of template code which is broken in 6.3. The effect is that the C initialisers for deftemplate entities are incorrectly generated. Eventually, I found that the bug is known about but for some reason the fix isn't in SVN? I'm submitting this patch in the hope that it makes it into SVN and that in the mean time no one else loses days in re-discovering the bug :-o
Steve.

---
For the record, the following is copied from http://groups.google.com/group/clipsesg/browse_thread/thread/5f0e4c2b7208db39
---

You can fix this in the CLIPS source code in the SlotToCode function in tmpltcmp.c, by adding the lines

fprintf(theFile,",");
PrintHashedExpressionReference(theEnv,theFile,theSlot->facetList,imageID,maxIndices);

after

fprintf(theFile,",");
PrintHashedExpressionReference(theEnv,theFile,theSlot->defaultList,imageID,maxIndices);

On Jun 29, 9:21 am, John Hennessy <oceansgr...@gmail.com> wrote:

- Hide quoted text -
- Show quoted text -
> Using 6.3, and small system - one template, essentially (deftemplate
> x (slot a) (slot b) (slot c)) - the generated code for struct
> templateSlot omits the struct expr *facetList initializer, resulting a
> a somewhat less than friendly compiler error. I've inserted NULL for
> the values and things seem to run fine, but I know that is wrong on oh-
> so-many levels.

Discussion

  • Steve James

    Steve James - 2009-12-14

    Add missing line to tmpltcmp.c

     
  • Gary Riley

    Gary Riley - 2009-12-16
    • status: open --> closed-fixed
     
  • Gary Riley

    Gary Riley - 2009-12-16

    Checked in change to svn